|
| 1 | + |
| 2 | +<ResourceDictionary |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:k="using:Microsoft.Kinect.Xaml.Controls"> |
| 6 | + |
| 7 | + <ExponentialEase x:Key="VisualStateEasingFunction" Exponent="7" /> |
| 8 | + |
| 9 | + <Style TargetType="k:KinectRegion"> |
| 10 | + <Setter Property="Template"> |
| 11 | + <Setter.Value> |
| 12 | + <ControlTemplate TargetType="k:KinectRegion"> |
| 13 | + <Border |
| 14 | + Background="{TemplateBinding Background}" |
| 15 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 16 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 17 | + > |
| 18 | + <Grid> |
| 19 | + <ContentPresenter x:Name="contentHolder" /> |
| 20 | + |
| 21 | + <!-- only change from default KinectRegion style, |
| 22 | + is the addition of a user viewer under cursor layer, |
| 23 | + but above content --> |
| 24 | + <k:KinectUserViewer Height="100" Width="121" |
| 25 | + HorizontalAlignment="Center" |
| 26 | + VerticalAlignment="Top" /> |
| 27 | + |
| 28 | + <Canvas x:Name="cursorRenderingLayer" Background="{x:Null}"/> |
| 29 | + </Grid> |
| 30 | + </Border> |
| 31 | + </ControlTemplate> |
| 32 | + </Setter.Value> |
| 33 | + </Setter> |
| 34 | + </Style> |
| 35 | + |
| 36 | + <!-- |
| 37 | + BackButtons have a small visible area. |
| 38 | + The changes in this style (change margin to padding, set kinectpressinset, |
| 39 | + add border to template to support padding) enable a larger hit test region |
| 40 | + for HandPointers |
| 41 | + --> |
| 42 | + <Style x:Key="KinectBackButtonStyle" TargetType="Button"> |
| 43 | + <Setter Property="MinWidth" Value="48"/> |
| 44 | + <Setter Property="MinHeight" Value="48"/> |
| 45 | + <Setter Property="Padding" Value="36,56,36,36" /> |
| 46 | + <Setter Property="k:KinectRegion.KinectPressInset" Value="36,56,36,36" /> |
| 47 | + <Setter Property="VerticalAlignment" Value="Top"/> |
| 48 | + <Setter Property="FontFamily" Value="Segoe UI Symbol"/> |
| 49 | + <Setter Property="FontWeight" Value="Normal"/> |
| 50 | + <Setter Property="FontSize" Value="56"/> |
| 51 | + <Setter Property="AutomationProperties.AutomationId" Value="BackButton"/> |
| 52 | + <Setter Property="AutomationProperties.Name" Value="Back"/> |
| 53 | + <Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/> |
| 54 | + <Setter Property="Template"> |
| 55 | + <Setter.Value> |
| 56 | + <ControlTemplate TargetType="Button"> |
| 57 | + <Grid x:Name="RootGrid"> |
| 58 | + <Border Padding="{TemplateBinding Padding}" Background="Transparent"> |
| 59 | + <Grid Margin="-1,-16,0,0"> |
| 60 | + <TextBlock x:Name="BackgroundGlyph" Text="" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/> |
| 61 | + <TextBlock x:Name="NormalGlyph" Text="" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/> |
| 62 | + <TextBlock x:Name="ArrowGlyph" Text="" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/> |
| 63 | + </Grid> |
| 64 | + </Border> |
| 65 | + <Rectangle |
| 66 | + x:Name="FocusVisualWhite" |
| 67 | + IsHitTestVisible="False" |
| 68 | + Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" |
| 69 | + StrokeEndLineCap="Square" |
| 70 | + StrokeDashArray="1,1" |
| 71 | + Opacity="0" |
| 72 | + StrokeDashOffset="1.5"/> |
| 73 | + <Rectangle |
| 74 | + x:Name="FocusVisualBlack" |
| 75 | + IsHitTestVisible="False" |
| 76 | + Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" |
| 77 | + StrokeEndLineCap="Square" |
| 78 | + StrokeDashArray="1,1" |
| 79 | + Opacity="0" |
| 80 | + StrokeDashOffset="0.5"/> |
| 81 | + |
| 82 | + <VisualStateManager.VisualStateGroups> |
| 83 | + <VisualStateGroup x:Name="CommonStates"> |
| 84 | + <VisualState x:Name="Normal" /> |
| 85 | + <VisualState x:Name="PointerOver"> |
| 86 | + <Storyboard> |
| 87 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground"> |
| 88 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/> |
| 89 | + </ObjectAnimationUsingKeyFrames> |
| 90 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground"> |
| 91 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/> |
| 92 | + </ObjectAnimationUsingKeyFrames> |
| 93 | + </Storyboard> |
| 94 | + </VisualState> |
| 95 | + <VisualState x:Name="Pressed"> |
| 96 | + <Storyboard> |
| 97 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground"> |
| 98 | + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/> |
| 99 | + </ObjectAnimationUsingKeyFrames> |
| 100 | + <DoubleAnimation |
| 101 | + Storyboard.TargetName="ArrowGlyph" |
| 102 | + Storyboard.TargetProperty="Opacity" |
| 103 | + To="1" |
| 104 | + Duration="0"/> |
| 105 | + <DoubleAnimation |
| 106 | + Storyboard.TargetName="NormalGlyph" |
| 107 | + Storyboard.TargetProperty="Opacity" |
| 108 | + To="0" |
| 109 | + Duration="0"/> |
| 110 | + </Storyboard> |
| 111 | + </VisualState> |
| 112 | + <VisualState x:Name="Disabled"> |
| 113 | + <Storyboard> |
| 114 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility"> |
| 115 | + <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> |
| 116 | + </ObjectAnimationUsingKeyFrames> |
| 117 | + </Storyboard> |
| 118 | + </VisualState> |
| 119 | + </VisualStateGroup> |
| 120 | + <VisualStateGroup x:Name="FocusStates"> |
| 121 | + <VisualState x:Name="Focused"> |
| 122 | + <Storyboard> |
| 123 | + <DoubleAnimation |
| 124 | + Storyboard.TargetName="FocusVisualWhite" |
| 125 | + Storyboard.TargetProperty="Opacity" |
| 126 | + To="1" |
| 127 | + Duration="0"/> |
| 128 | + <DoubleAnimation |
| 129 | + Storyboard.TargetName="FocusVisualBlack" |
| 130 | + Storyboard.TargetProperty="Opacity" |
| 131 | + To="1" |
| 132 | + Duration="0"/> |
| 133 | + </Storyboard> |
| 134 | + </VisualState> |
| 135 | + <VisualState x:Name="Unfocused" /> |
| 136 | + <VisualState x:Name="PointerFocused" /> |
| 137 | + </VisualStateGroup> |
| 138 | + </VisualStateManager.VisualStateGroups> |
| 139 | + </Grid> |
| 140 | + </ControlTemplate> |
| 141 | + </Setter.Value> |
| 142 | + </Setter> |
| 143 | + </Style> |
| 144 | + |
| 145 | +</ResourceDictionary> |
0 commit comments