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
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:Tango.Touch.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/Colors.xaml" />
<ResourceDictionary Source="../Resources/Fonts.xaml" />
<ResourceDictionary Source="../Styles/TouchButton.xaml" />
<ResourceDictionary Source="../Styles/TouchIconButton.xaml" />
<ResourceDictionary>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" />
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="TangoMessageBoxTitle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource TangoMessageBoxTitleFontSize}"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
</Style>
<Style TargetType="local:TouchPanel">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:TouchPanel">
<Border Background="{TemplateBinding Background}">
<Grid>
<keyboard:KeyboardView>
<Grid>
<DockPanel>
<ContentControl DockPanel.Dock="Top" Content="{TemplateBinding TaskBarElement}"></ContentControl>
<!--Notification Bar-->
<local:TouchNotificationBar NotificationBarVisibility="{TemplateBinding NotificationBarVisibility}" NotificationTemplate="{TemplateBinding NotificationTemplate}" HasNotifications="{TemplateBinding HasNotifications}" Notifications="{TemplateBinding Notifications}" ItemExpandedPropertyPath="{TemplateBinding ItemExpandedPropertyPath}">
<Grid>
<!--Content-->
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</local:TouchNotificationBar>
</DockPanel>
<!--Combo Box PopUp-->
<Grid Background="#9E000000" x:Name="PART_combobox_grid">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="0"></Setter>
<Setter Property="Visibility" Value="Hidden"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentComboBox,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True">
<Setter Property="Visibility" Value="Visible"></Setter>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentComboBox}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="5" Margin="10">
<Border.Effect>
<DropShadowEffect BlurRadius="10" />
</Border.Effect>
<Grid ClipToBounds="True">
<DockPanel>
<Grid DockPanel.Dock="Top">
<Border CornerRadius="5 5 0 0" Background="{StaticResource TangoComboBoxPopupTitleBackgroundBrush}" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 0 0 1" Padding="30">
<TextBlock DockPanel.Dock="Top" Text="{Binding Title}" FontSize="{StaticResource TangoComboBoxTitleFontSize}" FontWeight="SemiBold"></TextBlock>
</Border>
<local:TouchIconButton x:Name="PART_comboboxCloseButton" Background="Transparent" Padding="35" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="90" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="{StaticResource TangoDarkForegroundBrush}" Opacity="0.5" />
</Grid>
<local:TouchListBox x:Name="PART_ComboBoxList" Width="{Binding MinPopupWidth}" Height="{Binding MinPopupHeight}" ItemSelectedCommand="{Binding RelativeSource={RelativeSource AncestorType=local:TouchPanel},Path=ComboBoxPickedCommand}" ItemsSource="{Binding ItemsSource}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" SelectionMode="None" ItemTemplate="{Binding ItemTemplate}" ValuePath="{Binding ValuePath}" VerticalAlignment="Top" >
</local:TouchListBox>
</DockPanel>
</Grid>
</Border>
</Grid>
</Grid>
<!--Date Picker-->
<Grid Background="#9E000000" x:Name="PART_datepicker_grid">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="0"></Setter>
<Setter Property="Visibility" Value="Hidden"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDatePicker,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True">
<Setter Property="Visibility" Value="Visible"></Setter>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDatePicker}" VerticalAlignment="Center" HorizontalAlignment="Center">
<Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="5" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="10" />
</Border.Effect>
<DockPanel>
<StackPanel Margin="0 40 0 10" DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
<local:TouchButton Command="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CancelDateCommand}" Width="80" Margin="2 0" FontSize="{StaticResource TangoDefaultFontSize}" Style="{StaticResource TangoMessageBoxButton}">CANCEL</local:TouchButton>
<local:TouchButton Command="{Binding RelativeSource={RelativeSource TemplatedParent},Path=DateSelectedCommand}" Width="100" Margin="2 0" FontSize="{StaticResource TangoDefaultFontSize}" Style="{StaticResource TangoMessageBoxButton}">OK</local:TouchButton>
</StackPanel>
<local:TouchCalendar Width="370" x:Name="PART_calendar" Focusable="False"
SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDatePicker.SelectedDate,Mode=OneWay}"
DisplayDateStart="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDatePicker.DisplayDateStart,Mode=OneWay}"
DisplayDateEnd="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDatePicker.DisplayDateEnd,Mode=OneWay}"
/>
</DockPanel>
</Border>
</Grid>
</Grid>
<!--Dialogs-->
<Grid>
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="0"></Setter>
<Setter Property="Visibility" Value="Hidden"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HasDialog}" Value="True">
<Setter Property="Visibility" Value="Visible"></Setter>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid Background="#9E000000">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseUp">
<i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog.DataContext.CloseCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Grid>
<Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="5" Padding="10" HorizontalAlignment="Center" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="10" />
</Border.Effect>
<ContentPresenter Content="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog}" />
</Border>
</Grid>
<!--Messages-->
<Grid Background="#9E000000">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Opacity" Value="0"></Setter>
<Setter Property="Visibility" Value="Hidden"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HasMessageBox}" Value="True">
<Setter Property="Visibility" Value="Visible"></Setter>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid Height="360" Margin="20" RenderTransformOrigin="0.5,0.5">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="0" ScaleY="0" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HasMessageBox}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="0" To="1" Duration="00:00:0.1" />
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="0" To="1" Duration="00:00:0.1" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="1" To="0" Duration="00:00:0.1" />
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="1" To="0" Duration="00:00:0.1" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Border DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentMessageBox}" Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10">
<Border.Effect>
<DropShadowEffect BlurRadius="10" />
</Border.Effect>
<Grid ClipToBounds="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="75*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition Height="1*" />
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<local:TouchIcon Grid.Row="0" Icon="{Binding Icon}" Margin="20" Foreground="{Binding Brush}" />
<TextBlock Grid.Column="1" Text="{Binding Title,TargetNullValue=Confirm}" Foreground="{Binding Brush,TargetNullValue={StaticResource TangoPrimaryAccentBrush}}" VerticalAlignment="Center" Margin="10" Style="{StaticResource TangoMessageBoxTitle}"></TextBlock>
<Rectangle Stroke="{Binding Brush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2" StrokeThickness="3" />
<TextBlock Grid.Row="1" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" Text="{Binding Message}" VerticalAlignment="Top" Grid.Column="1" TextWrapping="Wrap" Margin="10 20 10 10"></TextBlock>
<!--<Rectangle Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom" Grid.Row="1" Grid.ColumnSpan="2" StrokeThickness="1"/>-->
<StackPanel Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
<local:TouchButton x:Name="btnCancel" Width="120" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding CloseCommand}" Visibility="{Binding HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}">CANCEL</local:TouchButton>
<local:TouchButton x:Name="btnOK" Width="180" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding OKCommand}">OK</local:TouchButton>
</StackPanel>
</Grid>
</Border>
</Grid>
</Grid>
</Grid>
</keyboard:KeyboardView>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
|