Rev 2374 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2374 | Rev 2377 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <Window x:Class="KeyPad.Keypad" |
1 | <Window x:Class="KeyPad.Keypad" |
2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
- | 4 | xmlns:local="clr-namespace:KeyPad" |
|
4 | Title="MainWindow" Height="313" Width="299" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" > |
5 | Title="MainWindow" Height="313" Width="299" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" > |
5 | <Window.Resources> |
6 | <Window.Resources> |
6 | <DropShadowEffect x:Key="DropShadowEffect" |
7 | <DropShadowEffect x:Key="DropShadowEffect" |
7 | ShadowDepth="1" |
8 | ShadowDepth="1" |
8 | Direction="-90" |
9 | Direction="-90" |
Line 115... | Line 116... | ||
115 | </Grid.ColumnDefinitions> |
116 | </Grid.ColumnDefinitions> |
Line 116... | Line 117... | ||
116 | 117 | ||
117 | <Grid Grid.Row="1"> |
118 | <Grid Grid.Row="1"> |
118 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
119 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
119 | <Button Name="button5" Background="WhiteSmoke" BorderThickness="1" |
120 | <Button Name="button5" Background="WhiteSmoke" BorderThickness="1" |
120 | Command="{Binding Path=PressAndRelease}" CommandParameter="NUMPAD7" Click="button_Click">7</Button> |
121 | CommandParameter="NUMPAD7" Click="button_Click">7</Button> |
121 | </Grid> |
122 | </Grid> |
122 | <Grid Grid.Column="1" Grid.Row="1"> |
123 | <Grid Grid.Column="1" Grid.Row="1"> |
123 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
124 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
124 | <Button x:Name="button6" Background="WhiteSmoke" |
125 | <Button x:Name="button6" Background="WhiteSmoke" |
125 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD8" Click="button_Click" BorderThickness="1" Content="8" /> |
126 | CommandParameter="NUMPAD8" Click="button_Click" BorderThickness="1" Content="8" /> |
126 | </Grid> |
127 | </Grid> |
127 | <Grid Grid.Column="2" Grid.Row="1"> |
128 | <Grid Grid.Column="2" Grid.Row="1"> |
128 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
129 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
129 | <Button x:Name="button7" Background="WhiteSmoke" |
130 | <Button x:Name="button7" Background="WhiteSmoke" |
130 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD9" Click="button_Click" Content="9" /> |
131 | CommandParameter="NUMPAD9" Click="button_Click" Content="9" /> |
131 | </Grid> |
132 | </Grid> |
132 | <Grid Grid.Column="3" Grid.Row="1"> |
133 | <Grid Grid.Column="3" Grid.Row="1"> |
133 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
134 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
134 | <Button x:Name="button8" Command="{Binding PressAndRelease}" CommandParameter="BACK" Click="button_Click"> |
135 | <Button x:Name="button8" 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 | <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 | </Button> |
137 | </Grid> |
138 | </Grid> |
138 | <Grid Grid.Row="2"> |
139 | <Grid Grid.Row="2"> |
139 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
140 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
140 | <Button x:Name="button9" Background="WhiteSmoke" |
141 | <Button x:Name="button9" Background="WhiteSmoke" |
141 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD4" Click="button_Click" Content="4"/> |
142 | CommandParameter="NUMPAD4" Click="button_Click" Content="4"/> |
142 | </Grid> |
143 | </Grid> |
143 | <Grid Grid.Column="1" Grid.Row="2"> |
144 | <Grid Grid.Column="1" Grid.Row="2"> |
144 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
145 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
145 | <Button x:Name="button10" Background="WhiteSmoke" |
146 | <Button x:Name="button10" Background="WhiteSmoke" |
146 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD5" Click="button_Click" Content="5" /> |
147 | CommandParameter="NUMPAD5" Click="button_Click" Content="5" /> |
147 | </Grid> |
148 | </Grid> |
148 | <Grid Grid.Column="2" Grid.Row="2"> |
149 | <Grid Grid.Column="2" Grid.Row="2"> |
149 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
150 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
150 | <Button x:Name="button11" Background="WhiteSmoke" |
151 | <Button x:Name="button11" Background="WhiteSmoke" |
151 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD6" Click="button_Click" Content="6" /> |
152 | CommandParameter="NUMPAD6" Click="button_Click" Content="6" /> |
152 | </Grid> |
153 | </Grid> |
153 | <Grid Grid.Row="3"> |
154 | <Grid Grid.Row="3"> |
154 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
155 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
155 | <Button x:Name="button13" Background="WhiteSmoke" |
156 | <Button x:Name="button13" Background="WhiteSmoke" |
156 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD1" Click="button_Click" Content="1"/> |
157 | CommandParameter="NUMPAD1" Click="button_Click" Content="1"/> |
157 | </Grid> |
158 | </Grid> |
158 | <Grid Grid.Column="1" Grid.Row="3"> |
159 | <Grid Grid.Column="1" Grid.Row="3"> |
159 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
160 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
160 | <Button x:Name="button14" Background="WhiteSmoke" |
161 | <Button x:Name="button14" Background="WhiteSmoke" |
161 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD2" Click="button_Click" Content="2"/> |
162 | CommandParameter="NUMPAD2" Click="button_Click" Content="2"/> |
162 | </Grid> |
163 | </Grid> |
163 | <Grid Grid.Column="2" Grid.Row="3"> |
164 | <Grid Grid.Column="2" Grid.Row="3"> |
164 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
165 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
165 | <Button x:Name="button15" Background="WhiteSmoke" |
166 | <Button x:Name="button15" Background="WhiteSmoke" |
166 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD3" Click="button_Click" Content="3" /> |
167 | CommandParameter="NUMPAD3" Click="button_Click" Content="3" /> |
167 | </Grid> |
168 | </Grid> |
168 | <Grid Grid.Column="3" Grid.Row="2" Grid.RowSpan="3"> |
169 | <Grid Grid.Column="3" Grid.Row="2" Grid.RowSpan="3"> |
169 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
170 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
170 | <Button x:Name="button16" |
171 | <Button x:Name="button16" |
171 | Command="{Binding PressAndRelease}" CommandParameter="RETURN" Click="button_Click" Content="Enter"/> |
172 | CommandParameter="RETURN" Click="button_Click" Content="Enter"/> |
172 | </Grid> |
173 | </Grid> |
173 | <Grid Grid.ColumnSpan="2" Grid.Row="4"> |
174 | <Grid Grid.ColumnSpan="2" Grid.Row="4"> |
174 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
175 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
175 | <Button x:Name="button17" Background="WhiteSmoke" |
176 | <Button x:Name="button17" Background="WhiteSmoke" |
176 | Command="{Binding PressAndRelease}" CommandParameter="NUMPAD0" Click="button_Click" Content="0" /> |
177 | CommandParameter="NUMPAD0" Click="button_Click" Content="0" /> |
177 | </Grid> |
178 | </Grid> |
178 | <Grid x:Name="gDecimal" Grid.Column="2" Grid.Row="4"> |
179 | <Grid x:Name="gDecimal" Grid.Column="2" Grid.Row="4"> |
179 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
180 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
180 | <Button x:Name="button19" Background="WhiteSmoke" |
181 | <Button x:Name="button19" Background="WhiteSmoke" |
181 | Command="{Binding PressAndRelease}" CommandParameter="DECIMAL" Click="button_Click" Content="," /> |
182 | CommandParameter="DECIMAL" Click="button_Click" Content="," /> |
182 | </Grid> |
183 | </Grid> |
183 | <Grid Grid.ColumnSpan="3"> |
184 | <Grid Grid.ColumnSpan="3"> |
184 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="0" > |
185 | <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 | <!--<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Text="{Binding Result}" VerticalAlignment="Top" Width="212" AllowDrop="False" IsUndoEnabled="False" IsReadOnly="True"/>--> |
186 | </Border> |
187 | </Border> |
- | 188 | <Label Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4" Visibility="Hidden"/> |
|
Line 187... | Line 189... | ||
187 | <Label Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4"/> |
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"/> |
188 | 190 | ||
189 | </Grid> |
191 | </Grid> |
190 | <Grid Grid.Column="3" > |
192 | <Grid Grid.Column="3" > |
191 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
193 | <Border Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" /> |
192 | <Button x:Name="buttonClear" Grid.Row="0" |
194 | <Button x:Name="buttonClear" Grid.Row="0" |
193 | Command="{Binding PressAndRelease}" CommandParameter="Clear" Click="button_Click" Content="C"/> |
195 | CommandParameter="Clear" Click="button_Click" Content="C"/> |
194 | <!--<Button x:Name="buttonEsc" Grid.Row="0" |
196 | <!--<Button x:Name="buttonEsc" Grid.Row="0" |
Line 195... | Line 197... | ||
195 | Command="{Binding PressAndRelease}" CommandParameter="ESC" Click="button_Click" Content="Esc"/>--> |
197 | Command="{Binding PressAndRelease}" CommandParameter="ESC" Click="button_Click" Content="Esc"/>--> |