Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2357 - 1
<Window x:Class="KeyPad.Keypad"
2
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
		Title="MainWindow" Height="313" Width="299" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" >
5
	<Window.Resources>
6
		<DropShadowEffect x:Key="DropShadowEffect"
7
						  ShadowDepth="1"
8
						  Direction="-90"
9
						  BlurRadius="5"
10
						  />
11
		<Style TargetType="Label">
12
			<Setter Property="FontSize" Value="22"/>
13
		</Style>
14
		<LinearGradientBrush x:Key="IPhoneSteelBackground" EndPoint="0.5,1.272" StartPoint="0.5,0">
15
			<GradientStop Color="#FF9097A3" Offset="0"/>
16
			<GradientStop Color="#FF444D5B" Offset="1"/>
17
		</LinearGradientBrush>
18
		<!--<Storyboard x:Key="sbdShowNum">-->
19
			<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
20
				<ObjectAnimationUsingKeyFrames.KeyFrames>
21
					<DiscreteObjectKeyFrame KeyTime="00:00:0.001">
22
						<DiscreteObjectKeyFrame.Value>
23
							<Visibility>Visible</Visibility>
24
						</DiscreteObjectKeyFrame.Value>
25
					</DiscreteObjectKeyFrame>
26
				</ObjectAnimationUsingKeyFrames.KeyFrames>
27
			</ObjectAnimationUsingKeyFrames>-->
28
			<!--<DoubleAnimation
29
				Storyboard.TargetName="NumKeyboard"
30
				Storyboard.TargetProperty="Opacity"
31
				 From="0"
32
				 To="1"
33
				 Duration="0:0:0.5"
34
				 />
35
				<DoubleAnimation
36
				Storyboard.TargetName="AlfaKeyboard"
37
				Storyboard.TargetProperty="Opacity"
38
				 From="1"
39
				 To="0"
40
				 Duration="0:0:0.5"
41
			 />-->
42
		<!--</Storyboard>
43
		<Storyboard x:Key="sbdShowAlfa">-->
44
			<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
45
				<ObjectAnimationUsingKeyFrames.KeyFrames>
46
					<DiscreteObjectKeyFrame KeyTime="00:00:0.001">
47
						<DiscreteObjectKeyFrame.Value>
48
							<Visibility>Collapsed</Visibility>
49
						</DiscreteObjectKeyFrame.Value>
50
					</DiscreteObjectKeyFrame>
51
				</ObjectAnimationUsingKeyFrames.KeyFrames>
52
			</ObjectAnimationUsingKeyFrames>-->
53
			<!--<DoubleAnimation
54
				Storyboard.TargetName="AlfaKeyboard"
55
				Storyboard.TargetProperty="Opacity"
56
				 From="0"
57
				 To="1"
58
				 Duration="0:0:0.5"
59
				 />
60
						<DoubleAnimation
61
				Storyboard.TargetName="NumKeyboard"
62
				Storyboard.TargetProperty="Opacity"
63
				 From="1"
64
				 To="0"
65
				 Duration="0:0:0.5"
66
		   />-->
67
		<!--</Storyboard>
68
 
69
		<Storyboard x:Key="sbFlashBigKey">-->
70
			<!--briefly display and hide (flash) a large label with the name of the just pressed key-->
71
 
72
			<!--<DoubleAnimation
73
				Storyboard.TargetName="AlfaKeyboard"
74
				Storyboard.TargetProperty="Opacity"
75
				 From="1"
76
				 To="0"
77
				 Duration="0:0:0.2"
78
				 />
79
				<DoubleAnimation
80
				Storyboard.TargetName="AlfaKeyboard"
81
				Storyboard.TargetProperty="Opacity"
82
				 From="0"
83
				 To="1"
84
				 Duration="0:0:0.2"
85
			 />-->
86
		<!--</Storyboard>-->
87
		<Style x:Key="buttonBorder" TargetType="Border" >
88
			<Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>
89
			<Setter Property="Margin" Value="4"/>
90
		</Style>
91
 
92
		<Style TargetType="Button">
93
			<!--<Setter Property="ClickMode" Value="Press"/>-->
94
			<Setter Property="Margin" Value="4"/>
95
			<!--<Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>-->
96
			<Setter Property="FontSize" Value="24"/>
97
		</Style>
98
	</Window.Resources>
99
 
100
 
101
 
102
	<Grid Background="{DynamicResource IPhoneSteelBackground}">
103
		<Grid.RowDefinitions>
104
			<RowDefinition />
105
			<RowDefinition />
106
			<RowDefinition />
107
			<RowDefinition />
108
			<RowDefinition />
109
		</Grid.RowDefinitions>
110
		<Grid.ColumnDefinitions>
111
			<ColumnDefinition />
112
			<ColumnDefinition />
113
			<ColumnDefinition />
114
			<ColumnDefinition />
115
		</Grid.ColumnDefinitions>
116
 
117
		<Grid  Grid.Row="1">
118
		<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
119
		<Button Name="button5" Background="WhiteSmoke" BorderThickness="1"
120
				Command="{Binding Path=PressAndRelease}" CommandParameter="NUMPAD7" Click="button_Click">7</Button>
121
		</Grid>
122
		<Grid Grid.Column="1" Grid.Row="1">
123
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
124
			<Button x:Name="button6" Background="WhiteSmoke"
125
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD8" Click="button_Click" BorderThickness="1" Content="8" />
126
		</Grid>
127
		<Grid Grid.Column="2" Grid.Row="1">
128
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
129
			<Button x:Name="button7" Background="WhiteSmoke"
130
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD9" Click="button_Click" Content="9" />
131
		</Grid>
132
		<Grid Grid.Column="3" Grid.Row="1">
133
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
134
			<Button x:Name="button8" Command="{Binding PressAndRelease}" CommandParameter="BACK" Click="button_Click">
135
				<Path Stretch="Fill" Width="36" Height="24" Data="F1M555.0371,274.4893L552.7871,276.7383L549.9861,273.9373L547.1991,276.7243L545.1131,274.6393L547.9001,271.8523L545.0101,268.9603L547.2601,266.7113L550.1501,269.6023L552.8921,266.8613L554.9761,268.9463L552.2361,271.6883z M555.3751,264.0003L544.8751,264.0003C543.1251,264.1253,535.0001,270.7503,535.0001,272.2503C535.0001,273.7503,543.1251,279.3753,544.8751,279.5003L555.3751,279.5003C558.8751,279.5003,559.3751,277.7093,559.3751,275.5003L559.3751,268.0003C559.3751,265.7913,558.7501,264.0003,555.3751,264.0003" Fill="#FF333333"/>
136
			</Button>
137
		</Grid>
138
		<Grid Grid.Row="2">
139
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
140
			<Button x:Name="button9" Background="WhiteSmoke"
141
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD4" Click="button_Click" Content="4"/>
142
		</Grid>
143
		<Grid Grid.Column="1" Grid.Row="2">
144
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
145
			<Button x:Name="button10" Background="WhiteSmoke"
146
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD5" Click="button_Click" Content="5" />
147
		</Grid>
148
		<Grid Grid.Column="2" Grid.Row="2">
149
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
150
			<Button x:Name="button11" Background="WhiteSmoke"
151
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD6" Click="button_Click" Content="6" />
152
		</Grid>
153
		<Grid Grid.Row="3">
154
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
155
			<Button x:Name="button13" Background="WhiteSmoke"
156
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD1" Click="button_Click" Content="1"/>
157
		</Grid>
158
		<Grid Grid.Column="1" Grid.Row="3">
159
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
160
			<Button x:Name="button14" Background="WhiteSmoke"
161
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD2" Click="button_Click" Content="2"/>
162
		</Grid>
163
		<Grid Grid.Column="2" Grid.Row="3">
164
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
165
			<Button x:Name="button15" Background="WhiteSmoke"
166
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD3" Click="button_Click" Content="3" />
167
		</Grid>
168
		<Grid Grid.Column="3" Grid.Row="2" Grid.RowSpan="3">
169
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
170
			<Button  x:Name="button16"
171
				Command="{Binding PressAndRelease}" CommandParameter="RETURN" Click="button_Click" Content="Enter"/>
172
		</Grid>
173
		<Grid Grid.ColumnSpan="2" Grid.Row="4">
174
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
175
			<Button x:Name="button17" Background="WhiteSmoke"
176
				Command="{Binding PressAndRelease}" CommandParameter="NUMPAD0" Click="button_Click" Content="0" />
177
		</Grid>
2364 - 178
		<Grid x:Name="gDecimal" Grid.Column="2" Grid.Row="4">
2357 - 179
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
180
			<Button x:Name="button19" Background="WhiteSmoke"
2364 - 181
				Command="{Binding PressAndRelease}" CommandParameter="DECIMAL"	Click="button_Click" Content="," />
2357 - 182
		</Grid>
183
		<Grid Grid.ColumnSpan="3">
2364 - 184
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="0" >
185
                <!--<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Text="{Binding Result}" VerticalAlignment="Top" Width="212" AllowDrop="False" IsUndoEnabled="False" IsReadOnly="True"/>-->
186
            </Border>
187
            <Label  Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4"/>
188
 
2357 - 189
		</Grid>
190
		<Grid Grid.Column="3" >
191
			<Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
192
			<Button x:Name="buttonEsc" Grid.Row="0"
193
				Command="{Binding PressAndRelease}" CommandParameter="ESC" Click="button_Click" Content="Esc"/>
194
		</Grid>
195
 
196
	</Grid>
197
</Window>