2013-03-05 46 views
0

我想在從一個用戶控件導航到另一個用戶控件時創建一些動畫。它可以是任何簡單的動畫,如我們在MS PowerPoint中的效果。用戶控件間導航時的動畫

我該如何開始?

編輯:

讓我們下面的XAML

<StackPanel> 
        <Label> 
         <Hyperlink Click="ConfigureAccounts_Click"> 
          <TextBlock>Configure Accounts</TextBlock> 
         </Hyperlink> 
        </Label> 
        <Label> 
         <Hyperlink Click="ConfigurePassangersList_Click"> 
          <TextBlock>Accounts</TextBlock> 
         </Hyperlink> 
        </Label> 
       </StackPanel> 

這裏的超鏈接的點擊我這樣做 -

private void ConfigureAccounts_Click(object sender, RoutedEventArgs e) 
    { 
     ContentGrid.Children.Clear(); 
     //Here is the animation 
     ContentGrid.Children.Add(new ConfigureAccounts()); 
    } 
    private void ConfigurePassangersList_Click(object sender, RoutedEventArgs e) 
    { 
     ContentGrid.Children.Clear(); 
     //Here is the animation 
     ContentGrid.Children.Add(new ConfigurePassangersList()); 
    } 

兩個構造函數其中我打電話只是用戶控件。

+0

http://whathaveyoutried.com/?請參閱[常見問題]和[提問] – 2013-03-05 10:41:45

回答

0

你可以利用鼠標懸停選項..改變colours.it將是一個簡單的開始。

,我不把這個作爲animation.if你真的需要動畫this.you需要使用閃光燈的腳本animation.this啓動是導航動畫最好的一個。

希望這會有所幫助。 :)

+0

我認爲它不能正常工作 – user2039445 2013-03-05 10:45:39

+0

ok..let我知道u有什麼樣的用戶控件,這樣我可以看到,如果我可以建議更好的東西 – user2075017 2013-03-05 10:53:48

+0

查看編輯部分 – user2039445 2013-03-05 11:45:37

2

WPF Bag of TricksTransitionPresenter類,這基本上是一個ContentPresenter支持動畫轉換:

基本用法:

<bot:TransitionPresenter Content="{Binding SomeViewModelForWhichYouHaveADataTemplateDefined}"> 
     <bot:TransitionPresenter.Transition> 
      <bot:FadeTransition Duration="00:00:00.3"/> 
     </bot:TransitionPresenter.Transition> 
    </bot:TransitionPresenter>