Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.61 KB | None | 0 0
  1. <Window x:Class="KinectHandTracking.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="Skeleton Basics" Height="768" Width="1366" Loaded="WindowLoaded" Closing="WindowClosing" WindowStartupLocation="CenterScreen" WindowState="Maximized" ResizeMode="NoResize" WindowStyle="None">
  5.  
  6. <Window.Resources>
  7. <SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e"/>
  8. <SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f"/>
  9. <SolidColorBrush x:Key="KinectBlueBrush" Color="#ff00BCF2"/>
  10. <Style TargetType="{x:Type Image}">
  11. <Setter Property="SnapsToDevicePixels" Value="True"/>
  12. </Style>
  13. <Style TargetType="{x:Type CheckBox}" x:Key="SquareCheckBox" >
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="{x:Type CheckBox}">
  17. <Grid>
  18. <StackPanel Orientation="Horizontal" Background="Transparent">
  19. <Grid x:Name="SquareCheckBoxChecked">
  20. <Image x:Name="CheckedNormal" Source="Images\CheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
  21. <Image x:Name="CheckedHover" Source="Images\CheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
  22. </Grid>
  23. <Grid x:Name="SquareCheckBoxUnchecked" Visibility="Collapsed">
  24. <Image x:Name="UncheckedNormal" Source="Images\UncheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
  25. <Image x:Name="UncheckedHover" Source="Images\UncheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
  26. </Grid>
  27. <TextBlock x:Name="SquareCheckBoxText" Text="{TemplateBinding Content}" TextAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource KinectPurpleBrush}" FontSize="15" Margin="9,0,0,0"/>
  28. </StackPanel>
  29. </Grid>
  30. <ControlTemplate.Triggers>
  31. <Trigger Property="IsChecked" Value="false">
  32. <Setter Property="Visibility" Value="Collapsed" TargetName="SquareCheckBoxChecked"/>
  33. <Setter Property="Visibility" Value="Visible" TargetName="SquareCheckBoxUnchecked"/>
  34. </Trigger>
  35. <Trigger Property="IsMouseOver" Value="true">
  36. <Setter Property="Visibility" Value="Collapsed" TargetName="CheckedNormal"/>
  37. <Setter Property="Visibility" Value="Collapsed" TargetName="UncheckedNormal"/>
  38. <Setter Property="Visibility" Value="Visible" TargetName="CheckedHover"/>
  39. <Setter Property="Visibility" Value="Visible" TargetName="UncheckedHover"/>
  40. <Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}" TargetName="SquareCheckBoxText"/>
  41. </Trigger>
  42. </ControlTemplate.Triggers>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. <Style TargetType="{x:Type Button}" x:Key="MyButtonStyle">
  48. <Setter Property="Button.Background">
  49. <Setter.Value>
  50. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  51. <GradientStop Color="#FF96CBFF" Offset="0"/>
  52. <GradientStop Color="#FF42FFDD" Offset="1"/>
  53. </LinearGradientBrush>
  54. </Setter.Value>
  55. </Setter>
  56.  
  57. <Setter Property="FontFamily" Value="Montserrat" />
  58. <Setter Property="HorizontalAlignment" Value="Stretch" />
  59. <Setter Property="FontSize" Value="30pt" />
  60. <Setter Property="Foreground" Value="White" />
  61. <Style.Triggers>
  62. <!-- Animates the button's opacity on mouse over. -->
  63. <EventTrigger RoutedEvent="Button.MouseEnter">
  64. <EventTrigger.Actions>
  65. <BeginStoryboard>
  66. <Storyboard>
  67. <DoubleAnimation
  68. Storyboard.TargetProperty="(Button.Opacity)"
  69. From="1.0" To="0.5" Duration="0:0:0.5" AutoReverse="True"
  70. RepeatBehavior="Forever" />
  71. </Storyboard>
  72. </BeginStoryboard>
  73. </EventTrigger.Actions>
  74. </EventTrigger>
  75.  
  76. <!-- Returns the button's opacity to 1 when the mouse leaves. -->
  77. <EventTrigger RoutedEvent="Button.MouseLeave">
  78. <EventTrigger.Actions>
  79. <BeginStoryboard>
  80. <Storyboard>
  81. <DoubleAnimation
  82. Storyboard.TargetProperty="(Button.Opacity)"
  83. To="1" Duration="0:0:0.1" />
  84. </Storyboard>
  85. </BeginStoryboard>
  86. </EventTrigger.Actions>
  87. </EventTrigger>
  88.  
  89. <!-- Changes the button's color when clicked.
  90. Notice that the animation can't target the
  91. SolidColorBrush used to paint the button's background
  92. directly. The brush must be accessed through the button's
  93. Background property. -->
  94. <EventTrigger RoutedEvent="Button.Click">
  95. <EventTrigger.Actions>
  96. <BeginStoryboard>
  97. <Storyboard>
  98. <ColorAnimation
  99. Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
  100. From="Orange" To="White" Duration="0:0:0.1" AutoReverse="True" />
  101. </Storyboard>
  102. </BeginStoryboard>
  103. </EventTrigger.Actions>
  104. </EventTrigger>
  105. </Style.Triggers>
  106. </Style>
  107. </Window.Resources>
  108. <Grid x:Name="mainGrid">
  109. <Grid.ColumnDefinitions>
  110. <ColumnDefinition Width="100*"/>
  111. <ColumnDefinition Width="20*"/>
  112. </Grid.ColumnDefinitions>
  113. <Grid x:Name="userControlGrid" Grid.Column="0" Margin="0">
  114. <Grid Name="layoutGrid" Margin="10,0,0,0" HorizontalAlignment="Left" Width="594">
  115. <Grid.RowDefinitions>
  116. <RowDefinition Height="Auto"/>
  117. <RowDefinition Height="*"/>
  118. <RowDefinition Height="Auto"/>
  119. <RowDefinition Height="Auto"/>
  120. </Grid.RowDefinitions>
  121. <DockPanel Grid.Row="0" Margin="0 0 0 20">
  122. <Image DockPanel.Dock="Left" Source="Images\Logo.png" Stretch="Fill" Height="32" Width="81" Margin="0 10 0 5"/>
  123. <Image Grid.Column="1" Source="Images\Status.png" Stretch="None" HorizontalAlignment="Center" Margin="0 0 0 5"/>
  124. </DockPanel>
  125. <Viewbox Grid.Row="1" Stretch="Uniform" HorizontalAlignment="Center">
  126. <Image Name="Image" Width="490" Height="480" RenderTransformOrigin="0.296,0.498" HorizontalAlignment="Left"/>
  127. </Viewbox>
  128. <CheckBox Grid.Row="2" Style="{StaticResource SquareCheckBox}" Content="Seated Mode" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 10 10 10" Name="checkBoxSeatedMode"/>
  129. <StatusBar Grid.Row="3" HorizontalAlignment="Stretch" Name="statusBar" VerticalAlignment="Bottom" Background="White" Foreground="{StaticResource MediumGreyBrush}">
  130. <StatusBarItem Padding="0 0 0 10">
  131. <TextBlock Name="statusBarText" Margin="-1 0 0 0">Click 'Seated' to change skeletal pipeline type!</TextBlock>
  132. </StatusBarItem>
  133. </StatusBar>
  134. <Image x:Name="imgBox" Height="567" Margin="613,0,-505,0" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="486"/>
  135. <Label x:Name="label3" Content="Gest" HorizontalAlignment="Left" Margin="266,512,0,0" Grid.Row="1" VerticalAlignment="Top" Width="252" Grid.RowSpan="3" FontSize="64"/>
  136. <Canvas x:Name="canvas">
  137. </Canvas>
  138. </Grid>
  139. </Grid>
  140. <Grid Name="ControlsGrid" Grid.Column="1" Margin="0" RenderTransformOrigin="0.514,0.297">
  141. <Grid.RowDefinitions>
  142. <RowDefinition/>
  143. <RowDefinition/>
  144. <RowDefinition/>
  145. <RowDefinition/>
  146. </Grid.RowDefinitions>
  147.  
  148. <Button x:Name="button_bus" Style="{StaticResource MyButtonStyle}" Content="Autobusy" Grid.Row="0" Click="Button_bus_Click"/>
  149. <Button x:Name="button_dab" Style="{StaticResource MyButtonStyle}" Content="Dab" Grid.Row="1" Click="Button_dab_Click"/>
  150. <Button x:Name="button_weather" Style="{StaticResource MyButtonStyle}" Content="Pogoda" Grid.Row="2" Click="Button_weather_Click"/>
  151. <Button x:Name="button_info" Style="{StaticResource MyButtonStyle}" Content="Informacje" Grid.Row="3" Click="Button_info_Click"/>
  152.  
  153.  
  154. </Grid>
  155.  
  156. </Grid>
  157. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement