1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
<UserControl x:Class="Tango.SharedUI.Keyboard.TouchKeyboard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters"
xmlns:local="clr-namespace:Tango.SharedUI.Keyboard"
xmlns:fa="http://schemas.fontawesome.io/icons/"
mc:Ignorable="d"
d:DesignHeight="250" d:DesignWidth="400" Focusable="False" Background="Silver" d:DataContext="{d:DesignInstance Type=UserControl, IsDesignTimeCreatable=True}" DataContext="{Binding RelativeSource={RelativeSource Self}}">
<UserControl.Resources>
<local:KeyboardModeToVisibilityConverter x:Key="KeyboardModeToVisibilityConverter" />
<local:KeyboardModeToVisibilityInverseConverter x:Key="KeyboardModeToVisibilityInverseConverter" />
<local:SpecialKeyDefinitionToWidthConverter x:Key="SpecialKeyDefinitionToWidthConverter" />
<converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:MathOperatorConverter x:Key="MathOperatorConverter" />
<Style x:Key="keyboardButton" TargetType="RepeatButton">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Focusable" Value="False"></Setter>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"></Setter>
</Trigger>
<Trigger Property="RepeatButton.IsPressed" Value="True">
<Setter Property="Opacity" Value="0.8"></Setter>
</Trigger>
<EventTrigger RoutedEvent="RepeatButton.TouchDown">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
<DiscreteDoubleKeyFrame KeyTime="0">
<DiscreteDoubleKeyFrame.Value>
0.8
</DiscreteDoubleKeyFrame.Value>
</DiscreteDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="RepeatButton.TouchUp">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
<DiscreteDoubleKeyFrame KeyTime="0">
<DiscreteDoubleKeyFrame.Value>
1
</DiscreteDoubleKeyFrame.Value>
</DiscreteDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Style.Triggers>
</Style>
<Style x:Key="normalButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
<Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeyDefinitionCommand}"></Setter>
<Setter Property="CommandParameter" Value="{Binding}"></Setter>
</Style>
<Style x:Key="numberButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
<Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeyDefinitionCommand}"></Setter>
<Setter Property="CommandParameter" Value="{Binding}"></Setter>
</Style>
<Style x:Key="specialButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
<Setter Property="Width">
<Setter.Value>
<MultiBinding Converter="{StaticResource SpecialKeyDefinitionToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="KeySize"></Binding>
<Binding Path="ColumnSpan"></Binding>
</MultiBinding>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialKeyDefinitionCommand}"></Setter>
<Setter Property="CommandParameter" Value="{Binding}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
<Grid>
<Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}">
<Path Data="{Binding VectorMarkup}" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Stretch="Uniform">
<Path.Style>
<Style TargetType="Path">
<Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}"></Setter>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CapsLockMode}" Value="{x:Static local:CapsLockMode.Locked}" />
<Condition Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}" />
</MultiDataTrigger.Conditions>
<Setter Property="Fill" Value="#47C904"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
</Viewbox>
<Ellipse Margin="2" HorizontalAlignment="Right" VerticalAlignment="Top" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsCapsLockOn}" Value="True">
<Setter Property="Fill" Value="#47C904"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="bottomButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Delay" Value="100000"></Setter>
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
<Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="bottomButtonDots" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Delay" Value="100000"></Setter>
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
<Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
<Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
<Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
<Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
</StackPanel>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="stretchedButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
<Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="numericButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=NumericKeyCommand}"></Setter>
<Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self},Path=Tag}"></Setter>
</Style>
</UserControl.Resources>
<Grid>
<!--AlphaNumeric-->
<Grid>
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Visibility" Value="Visible"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
<Setter Property="Visibility" Value="Collapsed"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding NumbersLineDefinition.KeyDefinitions}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="{Binding NumbersLineDefinition.KeyDefinitions.Count}"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RepeatButton Content="{Binding StandardText}" Style="{StaticResource numberButton}"></RepeatButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Grid Grid.Row="1">
<ItemsControl ItemsSource="{Binding CurrentKeyboardDefinition.KeysLinesDefinitions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding SpecialLeftKeyDefinitions}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RepeatButton Style="{StaticResource specialButton}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding SpecialRightKeyDefinitions}" Grid.Column="2" HorizontalAlignment="Right">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RepeatButton Style="{StaticResource specialButton}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding KeyDefinitions}" Grid.Column="1">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1" HorizontalAlignment="Center"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<RepeatButton Style="{StaticResource normalButton}">
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="{Binding StandardText}"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsCapsLockOn}" Value="True">
<Setter Property="Text" Value="{Binding CapsText}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</RepeatButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<Grid Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<RepeatButton Style="{StaticResource bottomButtonDots}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersCommand}">
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Content">
<Setter.Value>
<StackPanel Orientation="Horizontal">
<fa:ImageAwesome Icon="ShareAlt" Foreground="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Width="10" />
<TextBlock Margin="5 0 0 0">1#</TextBlock>
</StackPanel>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsSpecialCharactersOn}" Value="True">
<Setter Property="Content">
<Setter.Value>
<TextBlock>abc</TextBlock>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</RepeatButton>
<RepeatButton Command="{Binding NextLanguageCommand}" Style="{StaticResource bottomButtonDots}" Grid.Column="1" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<TextBlock Text="{Binding CurrentKeyboardDefinition.LanguageCode}"></TextBlock>
</RepeatButton>
<RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="/" Style="{StaticResource bottomButton}" Grid.Column="2" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<TextBlock Text="/"></TextBlock>
</RepeatButton>
<RepeatButton Style="{StaticResource stretchedButton}" Grid.Column="3" Command="{Binding FreeTextCommand}" CommandParameter=" ">
<DockPanel Margin="20 0" Height="10">
<Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Left" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Left" />
<Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Right" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Right" />
<Rectangle VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" />
</DockPanel>
</RepeatButton>
<RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="." Style="{StaticResource bottomButtonDots}" Grid.Column="4">
<TextBlock Text="."></TextBlock>
</RepeatButton>
<RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}">
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActionKeyText}"></TextBlock>
</RepeatButton>
</Grid>
</Grid>
</Grid>
<!--AlphaNumeric-->
<!--Numeric-->
<Grid>
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<UniformGrid Rows="4" Columns="4">
<RepeatButton Style="{StaticResource numericButton}" Tag="1">1</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="2">2</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="3">3</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="'{BACKSPACE}'" Background="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}" Foreground="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}">
<Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}">
<Path Fill="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Data="M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z"></Path>
</Viewbox>
</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="4">4</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="5">5</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="6">6</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="7">7</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="8">8</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="9">9</RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
<RepeatButton Style="{StaticResource numericButton}" Tag="0">0</RepeatButton>
<RepeatButton Tag=".">
<RepeatButton.Style>
<Style TargetType="RepeatButton" BasedOn="{StaticResource numericButton}">
<Setter Property="Content" Value=" "></Setter>
<Setter Property="IsEnabled" Value="False"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
<Setter Property="Content" Value="."></Setter>
<Setter Property="IsEnabled" Value="True"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</RepeatButton.Style>
</RepeatButton>
<RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}" Height="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}">
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActionKeyText}"></TextBlock>
</RepeatButton>
</UniformGrid>
</Grid>
<!--Numeric-->
</Grid>
</UserControl>
|