ScreensaverWindow.xaml
上传用户:liuqi822
上传日期:2022-03-21
资源大小:88k
文件大小:2k
源码类别:

屏幕保护

开发平台:

Visual C++

  1. <Window x:Class="Screensaver1.ScreensaverWindow"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.     WindowStartupLocation="Manual" 
  5.     WindowState="Maximized"
  6.     WindowStyle="None">
  7.     <Grid>
  8.         <ContentControl 
  9.                    RenderTransformOrigin="0.5, 0.5"
  10.                    VerticalAlignment="Center" 
  11.                    HorizontalAlignment="Center" 
  12.                    FontSize="20"
  13.                    Content="{Binding ScreensaverContent}">
  14.             <ContentControl.RenderTransform>
  15.                 <ScaleTransform />
  16.             </ContentControl.RenderTransform>
  17.             <ContentControl.Triggers>
  18.                 <EventTrigger RoutedEvent="FrameworkElement.Loaded">
  19.                     <BeginStoryboard>
  20.                         <Storyboard>
  21.                             <DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  22.                                 <SplineDoubleKeyFrame Value="2" KeyTime="00:00:05" />
  23.                                 <SplineDoubleKeyFrame Value="1" KeyTime="00:00:10" />
  24.                             </DoubleAnimationUsingKeyFrames>
  25.                             <DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
  26.                                 <SplineDoubleKeyFrame Value="2" KeyTime="00:00:05" />
  27.                                 <SplineDoubleKeyFrame Value="1" KeyTime="00:00:10" />
  28.                             </DoubleAnimationUsingKeyFrames>
  29.                         </Storyboard>
  30.                     </BeginStoryboard>
  31.                 </EventTrigger>
  32.             </ContentControl.Triggers>
  33.         </ContentControl>
  34.     </Grid>
  35. </Window>