Changeset 2421


Ignore:
Timestamp:
Jan 22, 2011, 2:47:15 PM (10 years ago)
Author:
sauer
Message:

Wizard: added page backward animation

Location:
trunk/CrypPlugins/Wizard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/Wizard/WizardControl.xaml

    r2394 r2421  
    5454        </Style>
    5555       
    56         <Storyboard x:Key="MainGridStoryboardLeft">
    57             <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="0" To="-900" Duration="0:0:0.5" Completed="LeftAnimation_Completed"/>
     56        <Storyboard x:Key="MainGridStoryboardNext1">
     57            <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="0" To="-1500" Duration="0:0:0.5" Completed="SetNextContent"/>
    5858        </Storyboard>
    59         <Storyboard x:Key="MainGridStoryboardRight">
    60             <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="900" To="0" Duration="0:0:0.5" Completed="RightAnimation_Completed"/>
     59        <Storyboard x:Key="MainGridStoryboardNext2">
     60            <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="1500" To="0" Duration="0:0:0.5"/>
     61        </Storyboard>
     62
     63        <Storyboard x:Key="MainGridStoryboardBack1">
     64            <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="0" To="1500" Duration="0:0:0.5" Completed="SetLastContent"/>
     65        </Storyboard>
     66        <Storyboard x:Key="MainGridStoryboardBack2">
     67            <DoubleAnimation Storyboard.TargetName="MainGridTransform" Storyboard.TargetProperty="X" From="-1500" To="0" Duration="0:0:0.5"/>
    6168        </Storyboard>
    6269    </UserControl.Resources>
  • trunk/CrypPlugins/Wizard/WizardControl.xaml.cs

    r2394 r2421  
    254254        private void nextButton_Click(object sender, RoutedEventArgs e)
    255255        {
    256             Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardLeft");
     256            Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardNext1");
    257257            mainGridStoryboardLeft.Begin();
    258258        }
     
    260260        private void backButton_Click(object sender, RoutedEventArgs e)
    261261        {
    262             ResetBackground();
    263             if (radioButtonStackPanel.Children.Count > 0)
    264             {
    265                 RadioButton b = (RadioButton)radioButtonStackPanel.Children[0];
    266                 XElement ele = (XElement)b.Tag;
    267                 radioButtonStackPanel.Children.Clear();
    268                 description.Text = "";
    269                 XElement grandParent = ele.Parent.Parent;
    270                 if (grandParent != null)
    271                     SetupPage(grandParent);
    272                 else
    273                     SetupPage(wizardConfigXML);
    274             }
     262            Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardBack1");
     263            mainGridStoryboardLeft.Begin();
    275264        }
    276265
     
    284273        }
    285274
    286         private void LeftAnimation_Completed(object sender, EventArgs e)
     275        private void SetNextContent(object sender, EventArgs e)
    287276        {
    288277            ResetBackground();
     
    300289            }
    301290
    302             Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardRight");
     291            Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardNext2");
    303292            mainGridStoryboardLeft.Begin();
    304293        }
    305294
    306         private void RightAnimation_Completed(object sender, EventArgs e)
    307         {
    308 
    309         }
    310 
     295
     296        private void SetLastContent(object sender, EventArgs e)
     297        {
     298            ResetBackground();
     299            if (radioButtonStackPanel.Children.Count > 0)
     300            {
     301                RadioButton b = (RadioButton)radioButtonStackPanel.Children[0];
     302                XElement ele = (XElement)b.Tag;
     303                radioButtonStackPanel.Children.Clear();
     304                description.Text = "";
     305                XElement grandParent = ele.Parent.Parent;
     306                if (grandParent != null)
     307                    SetupPage(grandParent);
     308                else
     309                    SetupPage(wizardConfigXML);
     310            }
     311
     312            Storyboard mainGridStoryboardLeft = (Storyboard)FindResource("MainGridStoryboardBack2");
     313            mainGridStoryboardLeft.Begin();
     314        }
    311315    }
    312316}
Note: See TracChangeset for help on using the changeset viewer.