PageRenderTime 62ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/CBR/CBR/Views/SimulateView.xaml

#
XAML | 167 lines | 161 code | 6 blank | 0 comment | 0 complexity | 48b58cb2d0d6b2253ea61ef6f61ee474 MD5 | raw file
  1. <Window
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" mc:Ignorable="d" x:Class="CBR.Views.SimulateView"
  5. Title="SimulateView" Height="400" Width="680" WindowStyle="None" WindowStartupLocation="CenterOwner" AllowsTransparency="True" Background="{x:Null}"
  6. MouseLeftButtonDown="Window_MouseLeftButtonDown" Loaded="Window_Loaded">
  7. <Window.Resources>
  8. <Style TargetType="{x:Type Button}" x:Key="WindowChromeButton">
  9. <Setter Property="OverridesDefaultStyle" Value="True"/>
  10. <Setter Property="IsTabStop" Value="False"/>
  11. <Setter Property="Focusable" Value="False"/>
  12. <Setter Property="Width" Value="30"/>
  13. <Setter Property="Height" Value="30"/>
  14. <Setter Property="HorizontalAlignment" Value="Center"/>
  15. <Setter Property="VerticalAlignment" Value="Center"/>
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="{x:Type Button}">
  19. <Grid Background="Transparent" SnapsToDevicePixels="True">
  20. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  21. </Grid>
  22. </ControlTemplate>
  23. </Setter.Value>
  24. </Setter>
  25. </Style>
  26. <Style x:Key="closeButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
  27. <Setter Property="Template">
  28. <Setter.Value>
  29. <ControlTemplate TargetType="{x:Type Button}">
  30. <Grid>
  31. <Rectangle Stretch="Fill" Fill="Transparent"/>
  32. <Line x:Name="line1" X1="0" Y1="0" X2="10" Y2="10" Stroke="White" StrokeThickness="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  33. <Line x:Name="line2" X1="10" Y1="0" X2="0" Y2="10" Stroke="White" StrokeThickness="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  34. </Grid>
  35. <ControlTemplate.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter TargetName="line1" Property="Stroke" Value="Gray"/>
  38. <Setter TargetName="line2" Property="Stroke" Value="Gray"/>
  39. </Trigger>
  40. <Trigger Property="IsPressed" Value="True">
  41. <Setter Property="RenderTransform" TargetName="line1">
  42. <Setter.Value>
  43. <TranslateTransform X="1" Y="1"/>
  44. </Setter.Value>
  45. </Setter>
  46. <Setter Property="RenderTransform" TargetName="line2">
  47. <Setter.Value>
  48. <TranslateTransform X="1" Y="1"/>
  49. </Setter.Value>
  50. </Setter>
  51. </Trigger>
  52. </ControlTemplate.Triggers>
  53. </ControlTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. <Style x:Key="swapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate TargetType="{x:Type Button}">
  61. <Grid Width="30" Height="30">
  62. <Rectangle Stretch="Fill" Fill="Transparent"/>
  63. <Rectangle x:Name="rect1" Width="28" Height="17" Stroke="White" StrokeThickness="3" HorizontalAlignment="Right" VerticalAlignment="Top" />
  64. <Rectangle x:Name="rect2" Width="17" Height="28" Stroke="White" StrokeThickness="3" HorizontalAlignment="Right" VerticalAlignment="Top" />
  65. <Path x:Name="Arrow1" Data="M2.4623262,20.418156 C3.2558038,25.413654 1.7900984,25.865824 7.8382856,27.675111" HorizontalAlignment="Left" Height="10.292" Margin="0.75,0,0,2.208" Stretch="Fill" Stroke="White" StrokeThickness="2" VerticalAlignment="Bottom" Width="8.208"/>
  66. <Path x:Name="Arrow2" Data="M7.7191389,16.286587 L10.69015,27.536028 2.2920932,32.511192" HorizontalAlignment="Left" Height="5.831" Margin="4.74,0,0,0.794" Stretch="Fill" VerticalAlignment="Bottom" Width="4.385" StrokeThickness="2" Stroke="White" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
  67. </Grid>
  68. <ControlTemplate.Triggers>
  69. <Trigger Property="IsMouseOver" Value="True">
  70. <Setter TargetName="rect1" Property="Stroke" Value="Gray"/>
  71. <Setter TargetName="rect2" Property="Stroke" Value="Gray"/>
  72. <Setter TargetName="Arrow1" Property="Stroke" Value="Gray"/>
  73. <Setter TargetName="Arrow2" Property="Stroke" Value="Gray"/>
  74. </Trigger>
  75. <Trigger Property="IsPressed" Value="True">
  76. <Setter Property="RenderTransform" TargetName="rect1">
  77. <Setter.Value>
  78. <TranslateTransform X="1" Y="1"/>
  79. </Setter.Value>
  80. </Setter>
  81. <Setter Property="RenderTransform" TargetName="rect2">
  82. <Setter.Value>
  83. <TranslateTransform X="1" Y="1"/>
  84. </Setter.Value>
  85. </Setter>
  86. </Trigger>
  87. </ControlTemplate.Triggers>
  88. </ControlTemplate>
  89. </Setter.Value>
  90. </Setter>
  91. </Style>
  92. <Style x:Key="playButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
  93. <Setter Property="Template">
  94. <Setter.Value>
  95. <ControlTemplate TargetType="{x:Type Button}">
  96. <Grid d:DesignWidth="30" d:DesignHeight="30">
  97. <Rectangle Stretch="Fill" Fill="Transparent"/>
  98. <Path x:Name="shape" Data="M4,4 L4,26 L26,15 z" Fill="White" />
  99. </Grid>
  100. <ControlTemplate.Triggers>
  101. <Trigger Property="IsMouseOver" Value="True">
  102. <Setter TargetName="shape" Property="Fill" Value="Gray"/>
  103. </Trigger>
  104. <Trigger Property="IsPressed" Value="True">
  105. <Setter Property="RenderTransform" TargetName="shape">
  106. <Setter.Value>
  107. <TranslateTransform X="1" Y="1"/>
  108. </Setter.Value>
  109. </Setter>
  110. </Trigger>
  111. </ControlTemplate.Triggers>
  112. </ControlTemplate>
  113. </Setter.Value>
  114. </Setter>
  115. </Style>
  116. <Style x:Key="pauseButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
  117. <Setter Property="Template">
  118. <Setter.Value>
  119. <ControlTemplate TargetType="{x:Type Button}">
  120. <Grid d:DesignWidth="30" d:DesignHeight="30">
  121. <Rectangle Stretch="Fill" Fill="Transparent"/>
  122. <Path x:Name="shape" Data="M8,4 L8,26 M21,4 L21,26" Stroke="White" StrokeThickness="6" Fill="White" />
  123. </Grid>
  124. <ControlTemplate.Triggers>
  125. <Trigger Property="IsMouseOver" Value="True">
  126. <Setter TargetName="shape" Property="Stroke" Value="Gray"/>
  127. </Trigger>
  128. <Trigger Property="IsPressed" Value="True">
  129. <Setter Property="RenderTransform" TargetName="shape">
  130. <Setter.Value>
  131. <TranslateTransform X="1" Y="1"/>
  132. </Setter.Value>
  133. </Setter>
  134. </Trigger>
  135. </ControlTemplate.Triggers>
  136. </ControlTemplate>
  137. </Setter.Value>
  138. </Setter>
  139. </Style>
  140. </Window.Resources>
  141. <Grid x:Name="mainGrid">
  142. <DockPanel Margin="5" Background="DarkGray" Height="32" VerticalAlignment="Top" HorizontalAlignment="Stretch">
  143. <Button Style="{StaticResource swapButton}" x:Name="btnSwapLandscape" Click="btnSwapLandscape_Click"/>
  144. <Button Style="{StaticResource playButton}" x:Name="btnPlay" />
  145. <Button Style="{StaticResource pauseButton}" x:Name="btnPause" />
  146. <Button Style="{StaticResource closeButton}" x:Name="btnClose" Click="btnClose_Click"/>
  147. <Label VerticalAlignment="Center" HorizontalAlignment="Stretch" x:Name="lblDebugInfo"/>
  148. </DockPanel>
  149. <Grid Margin="0,50,0,0">
  150. <Grid.Background>
  151. <ImageBrush ImageSource="/CBR;component/Resources/Images/phone_horizontal.png" />
  152. </Grid.Background>
  153. <Rectangle x:Name="rctZoom" Stroke="Red" Margin="52,28,111,32">
  154. <Rectangle.Fill>
  155. <ImageBrush TileMode="None"
  156. ViewboxUnits="Absolute" Viewbox="10,90,210,50" ViewportUnits="RelativeToBoundingBox" Viewport="0,0,1,1" />
  157. </Rectangle.Fill>
  158. </Rectangle>
  159. </Grid>
  160. </Grid>
  161. </Window>