Rev 2374 | Go to most recent revision | Details | Compare with Previous | 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" |
||
2377 | - | 4 | xmlns:local="clr-namespace:KeyPad" |
2357 | - | 5 | Title="MainWindow" Height="313" Width="299" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" > |
6 | <Window.Resources> |
||
7 | <DropShadowEffect x:Key="DropShadowEffect" |
||
8 | ShadowDepth="1" |
||
9 | Direction="-90" |
||
10 | BlurRadius="5" |
||
11 | /> |
||
12 | <Style TargetType="Label"> |
||
13 | <Setter Property="FontSize" Value="22"/> |
||
14 | </Style> |
||
15 | <LinearGradientBrush x:Key="IPhoneSteelBackground" EndPoint="0.5,1.272" StartPoint="0.5,0"> |
||
16 | <GradientStop Color="#FF9097A3" Offset="0"/> |
||
17 | <GradientStop Color="#FF444D5B" Offset="1"/> |
||
18 | </LinearGradientBrush> |
||
19 | <!--<Storyboard x:Key="sbdShowNum">--> |
||
20 | <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)"> |
||
21 | <ObjectAnimationUsingKeyFrames.KeyFrames> |
||
22 | <DiscreteObjectKeyFrame KeyTime="00:00:0.001"> |
||
23 | <DiscreteObjectKeyFrame.Value> |
||
24 | <Visibility>Visible</Visibility> |
||
25 | </DiscreteObjectKeyFrame.Value> |
||
26 | </DiscreteObjectKeyFrame> |
||
27 | </ObjectAnimationUsingKeyFrames.KeyFrames> |
||
28 | </ObjectAnimationUsingKeyFrames>--> |
||
29 | <!--<DoubleAnimation |
||
30 | Storyboard.TargetName="NumKeyboard" |
||
31 | Storyboard.TargetProperty="Opacity" |
||
32 | From="0" |
||
33 | To="1" |
||
34 | Duration="0:0:0.5" |
||
35 | /> |
||
36 | <DoubleAnimation |
||
37 | Storyboard.TargetName="AlfaKeyboard" |
||
38 | Storyboard.TargetProperty="Opacity" |
||
39 | From="1" |
||
40 | To="0" |
||
41 | Duration="0:0:0.5" |
||
42 | />--> |
||
43 | <!--</Storyboard> |
||
44 | <Storyboard x:Key="sbdShowAlfa">--> |
||
45 | <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)"> |
||
46 | <ObjectAnimationUsingKeyFrames.KeyFrames> |
||
47 | <DiscreteObjectKeyFrame KeyTime="00:00:0.001"> |
||
48 | <DiscreteObjectKeyFrame.Value> |
||
49 | <Visibility>Collapsed</Visibility> |
||
50 | </DiscreteObjectKeyFrame.Value> |
||
51 | </DiscreteObjectKeyFrame> |
||
52 | </ObjectAnimationUsingKeyFrames.KeyFrames> |
||
53 | </ObjectAnimationUsingKeyFrames>--> |
||
54 | <!--<DoubleAnimation |
||
55 | Storyboard.TargetName="AlfaKeyboard" |
||
56 | Storyboard.TargetProperty="Opacity" |
||
57 | From="0" |
||
58 | To="1" |
||
59 | Duration="0:0:0.5" |
||
60 | /> |
||
61 | <DoubleAnimation |
||
62 | Storyboard.TargetName="NumKeyboard" |
||
63 | Storyboard.TargetProperty="Opacity" |
||
64 | From="1" |
||
65 | To="0" |
||
66 | Duration="0:0:0.5" |
||
67 | />--> |
||
68 | <!--</Storyboard> |
||
69 | |||
70 | <Storyboard x:Key="sbFlashBigKey">--> |
||
71 | <!--briefly display and hide (flash) a large label with the name of the just pressed key--> |
||
72 | |||
73 | <!--<DoubleAnimation |
||
74 | Storyboard.TargetName="AlfaKeyboard" |
||
75 | Storyboard.TargetProperty="Opacity" |
||
76 | From="1" |
||
77 | To="0" |
||
78 | Duration="0:0:0.2" |
||
79 | /> |
||
80 | <DoubleAnimation |
||
81 | Storyboard.TargetName="AlfaKeyboard" |
||
82 | Storyboard.TargetProperty="Opacity" |
||
83 | From="0" |
||
84 | To="1" |
||
85 | Duration="0:0:0.2" |
||
86 | />--> |
||
87 | <!--</Storyboard>--> |
||
88 | <Style x:Key="buttonBorder" TargetType="Border" > |
||
89 | <Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/> |
||
90 | <Setter Property="Margin" Value="4"/> |
||
91 | </Style> |
||
92 | |||
93 | <Style TargetType="Button"> |
||
94 | <!--<Setter Property="ClickMode" Value="Press"/>--> |
||
95 | <Setter Property="Margin" Value="4"/> |
||
96 | <!--<Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>--> |
||
97 | <Setter Property="FontSize" Value="24"/> |
||
98 | </Style> |
||
99 | </Window.Resources> |
||
100 | |||
101 | |||
102 | |||
103 | <Grid Background="{DynamicResource IPhoneSteelBackground}"> |
||
104 | <Grid.RowDefinitions> |
||
105 | <RowDefinition /> |
||
106 | <RowDefinition /> |
||
107 | <RowDefinition /> |
||
108 | <RowDefinition /> |
||
109 | <RowDefinition /> |
||
110 | </Grid.RowDefinitions> |
||
111 | <Grid.ColumnDefinitions> |
||
112 | <ColumnDefinition /> |
||
113 | <ColumnDefinition /> |
||
114 | <ColumnDefinition /> |
||
115 | <ColumnDefinition /> |
||
116 | </Grid.ColumnDefinitions> |
||
117 | |||
118 | <Grid Grid.Row="1"> |
||
119 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
120 | <Button Name="button5" Background="WhiteSmoke" BorderThickness="1" |
||
2377 | - | 121 | CommandParameter="NUMPAD7" Click="button_Click">7</Button> |
2357 | - | 122 | </Grid> |
123 | <Grid Grid.Column="1" Grid.Row="1"> |
||
124 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
125 | <Button x:Name="button6" Background="WhiteSmoke" |
||
2377 | - | 126 | CommandParameter="NUMPAD8" Click="button_Click" BorderThickness="1" Content="8" /> |
2357 | - | 127 | </Grid> |
128 | <Grid Grid.Column="2" Grid.Row="1"> |
||
129 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
130 | <Button x:Name="button7" Background="WhiteSmoke" |
||
2377 | - | 131 | CommandParameter="NUMPAD9" Click="button_Click" Content="9" /> |
2357 | - | 132 | </Grid> |
133 | <Grid Grid.Column="3" Grid.Row="1"> |
||
134 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
2377 | - | 135 | <Button x:Name="button8" CommandParameter="BACK" Click="button_Click"> |
2357 | - | 136 | <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"/> |
137 | </Button> |
||
138 | </Grid> |
||
139 | <Grid Grid.Row="2"> |
||
140 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
141 | <Button x:Name="button9" Background="WhiteSmoke" |
||
2377 | - | 142 | CommandParameter="NUMPAD4" Click="button_Click" Content="4"/> |
2357 | - | 143 | </Grid> |
144 | <Grid Grid.Column="1" Grid.Row="2"> |
||
145 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
146 | <Button x:Name="button10" Background="WhiteSmoke" |
||
2377 | - | 147 | CommandParameter="NUMPAD5" Click="button_Click" Content="5" /> |
2357 | - | 148 | </Grid> |
149 | <Grid Grid.Column="2" Grid.Row="2"> |
||
150 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
151 | <Button x:Name="button11" Background="WhiteSmoke" |
||
2377 | - | 152 | CommandParameter="NUMPAD6" Click="button_Click" Content="6" /> |
2357 | - | 153 | </Grid> |
154 | <Grid Grid.Row="3"> |
||
155 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
156 | <Button x:Name="button13" Background="WhiteSmoke" |
||
2377 | - | 157 | CommandParameter="NUMPAD1" Click="button_Click" Content="1"/> |
2357 | - | 158 | </Grid> |
159 | <Grid Grid.Column="1" Grid.Row="3"> |
||
160 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
161 | <Button x:Name="button14" Background="WhiteSmoke" |
||
2377 | - | 162 | CommandParameter="NUMPAD2" Click="button_Click" Content="2"/> |
2357 | - | 163 | </Grid> |
164 | <Grid Grid.Column="2" Grid.Row="3"> |
||
165 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
166 | <Button x:Name="button15" Background="WhiteSmoke" |
||
2377 | - | 167 | CommandParameter="NUMPAD3" Click="button_Click" Content="3" /> |
2357 | - | 168 | </Grid> |
169 | <Grid Grid.Column="3" Grid.Row="2" Grid.RowSpan="3"> |
||
170 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
171 | <Button x:Name="button16" |
||
2377 | - | 172 | CommandParameter="RETURN" Click="button_Click" Content="Enter"/> |
2357 | - | 173 | </Grid> |
174 | <Grid Grid.ColumnSpan="2" Grid.Row="4"> |
||
175 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
176 | <Button x:Name="button17" Background="WhiteSmoke" |
||
2377 | - | 177 | CommandParameter="NUMPAD0" Click="button_Click" Content="0" /> |
2357 | - | 178 | </Grid> |
2364 | - | 179 | <Grid x:Name="gDecimal" Grid.Column="2" Grid.Row="4"> |
2357 | - | 180 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
181 | <Button x:Name="button19" Background="WhiteSmoke" |
||
2377 | - | 182 | CommandParameter="DECIMAL" Click="button_Click" Content="," /> |
2357 | - | 183 | </Grid> |
184 | <Grid Grid.ColumnSpan="3"> |
||
2364 | - | 185 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="0" > |
186 | <!--<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Text="{Binding Result}" VerticalAlignment="Top" Width="212" AllowDrop="False" IsUndoEnabled="False" IsReadOnly="True"/>--> |
||
187 | </Border> |
||
2377 | - | 188 | <Label Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4" Visibility="Hidden"/> |
189 | <TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Margin="4,4,0,0" Text="{Binding Result}" VerticalAlignment="Top" Width="212" FontSize="24" MaxLines="1" KeyDown="OnKeyDown" TextChanged="OnTextChanged"/> |
||
2364 | - | 190 | |
2377 | - | 191 | </Grid> |
2357 | - | 192 | <Grid Grid.Column="3" > |
193 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
||
2374 | - | 194 | <Button x:Name="buttonClear" Grid.Row="0" |
2377 | - | 195 | CommandParameter="Clear" Click="button_Click" Content="C"/> |
2374 | - | 196 | <!--<Button x:Name="buttonEsc" Grid.Row="0" |
197 | Command="{Binding PressAndRelease}" CommandParameter="ESC" Click="button_Click" Content="Esc"/>--> |
||
2357 | - | 198 | </Grid> |
199 | |||
200 | </Grid> |
||
201 | </Window> |