PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/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
  9        <Style TargetType="{x:Type Button}" x:Key="WindowChromeButton">
 10            <Setter Property="OverridesDefaultStyle" Value="True"/>
 11            <Setter Property="IsTabStop" Value="False"/>
 12            <Setter Property="Focusable" Value="False"/>
 13            <Setter Property="Width" Value="30"/>
 14            <Setter Property="Height" Value="30"/>
 15            <Setter Property="HorizontalAlignment" Value="Center"/>
 16            <Setter Property="VerticalAlignment" Value="Center"/>
 17            <Setter Property="Template">
 18                <Setter.Value>
 19                    <ControlTemplate TargetType="{x:Type Button}">
 20                        <Grid Background="Transparent" SnapsToDevicePixels="True">
 21                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
 22                        </Grid>
 23                    </ControlTemplate>
 24                </Setter.Value>
 25            </Setter>
 26        </Style>
 27
 28        <Style x:Key="closeButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
 29            <Setter Property="Template">
 30                <Setter.Value>
 31                    <ControlTemplate TargetType="{x:Type Button}">
 32                        <Grid>
 33                            <Rectangle Stretch="Fill" Fill="Transparent"/>
 34                            <Line x:Name="line1" X1="0" Y1="0" X2="10" Y2="10" Stroke="White" StrokeThickness="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
 35                            <Line x:Name="line2" X1="10" Y1="0" X2="0" Y2="10" Stroke="White" StrokeThickness="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
 36                        </Grid>
 37                        <ControlTemplate.Triggers>
 38                            <Trigger Property="IsMouseOver" Value="True">
 39                                <Setter TargetName="line1" Property="Stroke" Value="Gray"/>
 40                                <Setter TargetName="line2" Property="Stroke" Value="Gray"/>
 41                            </Trigger>
 42                            <Trigger Property="IsPressed" Value="True">
 43                                <Setter Property="RenderTransform" TargetName="line1">
 44                                    <Setter.Value>
 45                                        <TranslateTransform X="1" Y="1"/>
 46                                    </Setter.Value>
 47                                </Setter>
 48                                <Setter Property="RenderTransform" TargetName="line2">
 49                                    <Setter.Value>
 50                                        <TranslateTransform X="1" Y="1"/>
 51                                    </Setter.Value>
 52                                </Setter>
 53                            </Trigger>
 54                        </ControlTemplate.Triggers>
 55                    </ControlTemplate>
 56                </Setter.Value>
 57            </Setter>
 58        </Style>
 59
 60    	<Style x:Key="swapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
 61    		<Setter Property="Template">
 62    			<Setter.Value>
 63    				<ControlTemplate TargetType="{x:Type Button}">
 64    					<Grid Width="30" Height="30">
 65    						<Rectangle Stretch="Fill" Fill="Transparent"/>
 66    						<Rectangle x:Name="rect1" Width="28" Height="17" Stroke="White" StrokeThickness="3" HorizontalAlignment="Right" VerticalAlignment="Top" />
 67    						<Rectangle x:Name="rect2" Width="17" Height="28" Stroke="White" StrokeThickness="3" HorizontalAlignment="Right" VerticalAlignment="Top" />
 68    						<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"/>
 69    						<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"/>							
 70    					</Grid>
 71    					<ControlTemplate.Triggers>
 72    						<Trigger Property="IsMouseOver" Value="True">
 73    							<Setter TargetName="rect1" Property="Stroke" Value="Gray"/>
 74                                <Setter TargetName="rect2" Property="Stroke" Value="Gray"/>
 75                                <Setter TargetName="Arrow1" Property="Stroke" Value="Gray"/>
 76                                <Setter TargetName="Arrow2" Property="Stroke" Value="Gray"/>
 77                            </Trigger>
 78    						<Trigger Property="IsPressed" Value="True">
 79    							<Setter Property="RenderTransform" TargetName="rect1">
 80    								<Setter.Value>
 81    									<TranslateTransform X="1" Y="1"/>
 82    								</Setter.Value>
 83    							</Setter>
 84    							<Setter Property="RenderTransform" TargetName="rect2">
 85    								<Setter.Value>
 86    									<TranslateTransform X="1" Y="1"/>
 87    								</Setter.Value>
 88    							</Setter>
 89    						</Trigger>
 90    					</ControlTemplate.Triggers>
 91    				</ControlTemplate>
 92    			</Setter.Value>
 93    		</Setter>
 94    	</Style>
 95
 96        <Style x:Key="playButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
 97            <Setter Property="Template">
 98                <Setter.Value>
 99                    <ControlTemplate TargetType="{x:Type Button}">
100                    	<Grid d:DesignWidth="30" d:DesignHeight="30">
101                    		<Rectangle Stretch="Fill" Fill="Transparent"/>
102                    		<Path x:Name="shape" Data="M4,4 L4,26 L26,15 z" Fill="White" />
103                    	</Grid>
104                        <ControlTemplate.Triggers>
105                            <Trigger Property="IsMouseOver" Value="True">
106                                <Setter TargetName="shape" Property="Fill" Value="Gray"/>
107                            </Trigger>
108                            <Trigger Property="IsPressed" Value="True">
109                                <Setter Property="RenderTransform" TargetName="shape">
110                                    <Setter.Value>
111                                        <TranslateTransform X="1" Y="1"/>
112                                    </Setter.Value>
113                                </Setter>
114                            </Trigger>
115                        </ControlTemplate.Triggers>
116                    </ControlTemplate>
117                </Setter.Value>
118            </Setter>
119        </Style>
120
121        <Style x:Key="pauseButton" TargetType="{x:Type Button}" BasedOn="{StaticResource WindowChromeButton}">
122            <Setter Property="Template">
123                <Setter.Value>
124                    <ControlTemplate TargetType="{x:Type Button}">
125                        <Grid d:DesignWidth="30" d:DesignHeight="30">
126                            <Rectangle Stretch="Fill" Fill="Transparent"/>
127							<Path x:Name="shape" Data="M8,4 L8,26 M21,4 L21,26" Stroke="White" StrokeThickness="6" Fill="White" />
128                        </Grid>
129                        <ControlTemplate.Triggers>
130                            <Trigger Property="IsMouseOver" Value="True">
131                                <Setter TargetName="shape" Property="Stroke" Value="Gray"/>
132                            </Trigger>
133                            <Trigger Property="IsPressed" Value="True">
134                                <Setter Property="RenderTransform" TargetName="shape">
135                                    <Setter.Value>
136                                        <TranslateTransform X="1" Y="1"/>
137                                    </Setter.Value>
138                                </Setter>
139                            </Trigger>
140                        </ControlTemplate.Triggers>
141                    </ControlTemplate>
142                </Setter.Value>
143            </Setter>
144        </Style>
145
146    </Window.Resources>
147    <Grid x:Name="mainGrid">
148        <DockPanel Margin="5" Background="DarkGray" Height="32" VerticalAlignment="Top" HorizontalAlignment="Stretch">
149            <Button Style="{StaticResource swapButton}" x:Name="btnSwapLandscape" Click="btnSwapLandscape_Click"/>
150            <Button Style="{StaticResource playButton}" x:Name="btnPlay" />
151            <Button Style="{StaticResource pauseButton}" x:Name="btnPause" />
152            <Button Style="{StaticResource closeButton}" x:Name="btnClose" Click="btnClose_Click"/>
153            <Label VerticalAlignment="Center" HorizontalAlignment="Stretch" x:Name="lblDebugInfo"/>
154        </DockPanel>    
155        <Grid Margin="0,50,0,0">
156            <Grid.Background>
157                <ImageBrush ImageSource="/CBR;component/Resources/Images/phone_horizontal.png" />
158            </Grid.Background>
159            <Rectangle x:Name="rctZoom" Stroke="Red" Margin="52,28,111,32">
160                <Rectangle.Fill>
161                    <ImageBrush TileMode="None"
162                                 ViewboxUnits="Absolute" Viewbox="10,90,210,50" ViewportUnits="RelativeToBoundingBox" Viewport="0,0,1,1" />
163                </Rectangle.Fill>
164            </Rectangle>
165        </Grid>
166    </Grid>
167</Window>