2012-02-03 80 views
1

我有一个简单的自定义窗口(下面的XAML)。 第一次加载时,它会将用户控件添加到grdContainer.Children集合中。 用户选择/操作将导致其他用户控件添加/删除到子集合。 (一次加载一个)。我试图做的是在新控件加载时提供一个简单的动画,就像从左上角到右下角的45度滑动一样。更改用户控件的动画

如果任何人都可以指出我正确的方向,我将不胜感激。

<Window 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
x:Class="WinClientFolder" 
x:Name="WinClientFolder" 
Title="MainWindow" 
Width="450" Height="300" AllowsTransparency="True" WindowStyle="None" ResizeMode="CanResizeWithGrip"> 
<Window.Background> 
    <SolidColorBrush /> 
</Window.Background> 
<Grid x:Name="LayoutRoot"> 
    <Border BorderBrush="Black" BorderThickness="2,2,2,0" Margin="18,13,0,0" CornerRadius="10,10,0,0" Background="#FFCCC523" Height="32" VerticalAlignment="Top" HorizontalAlignment="Left" Width="179" Name="FolderTab"> 
     <Grid Height="25" HorizontalAlignment="Left" Name="grdFolderTop" VerticalAlignment="Top" Width="175"> 
      <TextBlock x:Name="txtClientName" Height="34" TextWrapping="NoWrap" Width="Auto" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,0,0"><Run Text="Doe, John Family " /><LineBreak /><Run /></TextBlock> 
     </Grid> 

    </Border> 
    <Border BorderBrush="Black" BorderThickness="2,1,6,2" Margin="0,45,0,0" Background="#FFCCC523" CornerRadius="10,10,0,0" Grid.ColumnSpan="2" Name="FolderBody"> 
     <Grid Height="Auto" Name="grdContainer" Width="Auto" /> 
    </Border> 
</Grid> 

回答

0

this post问一个有些类似的问题。我强烈推荐这个Transitionals框架。它使用简单,看起来很棒。

+0

非常感谢 - 我会试一试。 – topry 2012-02-05 13:08:29