当前位置: 代码迷 >> Silverlight >> WPF拉开窗帷效果
  详细解决方案

WPF拉开窗帷效果

热度:8972   发布时间:2013-02-26 00:00:00.0
WPF拉开窗帘效果
从一个界面跳转到另一个界面。另一个界面的显示方式类似于拉开窗帘,从左至右由暗变亮。
------解决方案--------------------------------------------------------
Expression Blend 专门做Silverlight动画的  同时也可以编辑跳转
------解决方案--------------------------------------------------------

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="SilverlightApplication11.MainPage"
Width="800" Height="600">
     
 <Border Background="White">
  <VisualStateManager.VisualStateGroups>
  <VisualStateGroup x:Name="VisualStateGroup">
  <VisualState x:Name="VisualState">
  <Storyboard>
  <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="button">
  <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  <SplineDoubleKeyFrame KeyTime="0:0:2" Value="1" KeySpline="1,0,1,1"/>
  </DoubleAnimationUsingKeyFrames>
  <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="button">
  <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  <SplineDoubleKeyFrame KeyTime="0:0:2" Value="258" KeySpline="1,0,1,1"/>
  </DoubleAnimationUsingKeyFrames>
  </Storyboard>
  </VisualState>
  </VisualStateGroup>
  </VisualStateManager.VisualStateGroups>
  <Button x:Name="button" Content="Button" HorizontalAlignment="Left" Margin="-224,200,0,299" Width="223" RenderTransformOrigin="0.5,0.5">
  <Button.Background>
  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  <GradientStop Color="Black" Offset="0"/>
  <GradientStop Color="#FFE90E0E" Offset="0.996"/>
  <GradientStop Color="#FE320303" Offset="0.278"/>
  </LinearGradientBrush>
  </Button.Background>
  <Button.RenderTransform>
  <CompositeTransform/>
  </Button.RenderTransform>
  </Button>
 </Border>

</UserControl>

刚刚用Blend随便画的,看看行不行
  相关解决方案