■ ObjectAnimationUsingKeyFrames 엘리먼트에서 DiscreteObjectKeyFrame 엘리먼트를 사용해 특정 객체의 속성값을 설정하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<?xml version="1.0" encoding="utf-8"?> <Page x:Class="TestProject.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" FontFamily="나눔고딕코딩" FontSize="16"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup> <VisualState x:Name="DefaultState"> <Storyboard /> </VisualState> <VisualState x:Name="WideState"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="splitView" Storyboard.TargetProperty="DisplayMode"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <SplitViewDisplayMode>Inline</SplitViewDisplayMode> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="splitView" Storyboard.TargetProperty="IsPaneOpen"> <DiscreteObjectKeyFrame KeyTime="0" Value="True" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <SplitView Name="splitView" DisplayMode="CompactInline" CompactPaneLength="20" IsPaneOpen="False"> </SplitView> </Grid> </Page> |