-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
302 lines (279 loc) · 16.4 KB
/
MainWindow.xaml
File metadata and controls
302 lines (279 loc) · 16.4 KB
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
<Window x:Class="Dropdown_Options.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
xmlns:local="clr-namespace:Dropdown_Options"
xmlns:global="clr-namespace:System.Globalization;assembly=mscorlib"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="DateTimeEdit - Selecting datetime options" Height="700" Width="800">
<Window.DataContext>
<local:ViewModel/>
</Window.DataContext>
<Window.Resources>
<DataTemplate x:Key="GroupBox_Header" DataType="DataTemplate">
<TextBlock FontWeight="Bold" Text="{Binding}"></TextBlock>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0">
<Grid>
<syncfusion:DateTimeEdit CanEdit="{Binding CanEdit}"
IsReadOnly="{Binding IsReadOnly}"
MinDateTime="{Binding MinDateTime}"
MaxDateTime="{Binding MaxDateTime}"
DropDownView="{Binding DropDownView}"
EnableDeleteKey="{Binding EnableDeleteKey}"
OnFocusBehavior="{Binding OnFocusBehavior}"
TodayButtonAction="{Binding TodayButtonAction}"
EnableBackspaceKey="{Binding EnableBackspaceKey}"
IsEmptyDateEnabled="{Binding IsEmptyDateEnabled}"
DisableDateSelection="{Binding DisableDateSelection}"
IsButtonPopUpEnabled="{Binding IsButtonPopUpEnabled}"
EnableMouseWheelEdit="{Binding EnableMouseWheelEdit}"
IsVisibleRepeatButton="{Binding IsVisibleRepeatButton}"
IsEnabledRepeatButton="{Binding IsEnabledRepeatButton}"
RepeatButtonBackground="{Binding RepeatButtonBackground}"
EnableAlphaKeyNavigation="{Binding EnableAlphaKeyNavigation}"
Name="dateTimeEdit"
Margin="20" Height="25" >
<syncfusion:DateTimeEdit.DateTimeFormat>
<global:DateTimeFormatInfo ShortDatePattern="MM/dd/yy hh:mm:ss"/>
</syncfusion:DateTimeEdit.DateTimeFormat>
</syncfusion:DateTimeEdit>
</Grid>
</Border>
<GroupBox Margin="10"
Grid.Column="1"
HeaderTemplate="{StaticResource GroupBox_Header}"
Header="User Options">
<Grid>
<StackPanel>
<!--Popup DateTime Selector-->
<GroupBox Margin="10"
Grid.Column="1"
Height="150"
HeaderTemplate="{StaticResource GroupBox_Header}"
Header="Popup DateTime Selector">
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="3"
Text ="DropDown View"
Grid.Row="0"
Grid.Column="0"/>
<ComboBox SelectedItem="{Binding DropDownView, Mode=TwoWay}"
Grid.Row="0"
Grid.Column="1"
Margin="3">
<syncfusion:DropDownViews>Calendar</syncfusion:DropDownViews>
<syncfusion:DropDownViews>Classic</syncfusion:DropDownViews>
<syncfusion:DropDownViews>Clock</syncfusion:DropDownViews>
<syncfusion:DropDownViews>Combined</syncfusion:DropDownViews>
</ComboBox>
<TextBlock Margin="3"
Text ="TodayButton Action"
Grid.Row="1"
Grid.Column="0"/>
<ComboBox SelectedItem="{Binding TodayButtonAction, Mode=TwoWay}"
Grid.Row="1"
Grid.Column="1"
Margin="3">
<syncfusion:TodayButtonAction>Date</syncfusion:TodayButtonAction>
<syncfusion:TodayButtonAction>DateTime</syncfusion:TodayButtonAction>
</ComboBox>
<TextBlock Margin="3"
Text ="Show DropDown button"
Grid.Row="2"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding IsButtonPopUpEnabled,Mode=TwoWay}"
Grid.Row="2"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Show None button to reset"
Grid.Row="3"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding IsEmptyDateEnabled,Mode=TwoWay}"
IsEnabled="{Binding IsButtonPopUpEnabled}"
Grid.Row="3"
Grid.Column="1"
Margin="3"/>
</Grid>
</GroupBox>
<!--Datetime Editing Options"-->
<GroupBox Margin="10"
Grid.Column="1"
Height="250"
HeaderTemplate="{StaticResource GroupBox_Header}"
Header="Datetime Editing Options">
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="3"
Text ="Free Flow Editing"
Grid.Row="0"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding CanEdit, Mode=TwoWay}"
Grid.Row="0"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Edit value on MouseWheel"
Grid.Row="1"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding EnableMouseWheelEdit, Mode=TwoWay}"
Grid.Row="1"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Show UpDown Button"
Grid.Row="2"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding IsVisibleRepeatButton,Mode=TwoWay}"
Grid.Row="2"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Enable UpDown Button"
Grid.Row="3"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding IsEnabledRepeatButton,Mode=TwoWay}"
Grid.Row="3"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Change Month on KeyPress"
Grid.Row="4"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding EnableAlphaKeyNavigation,Mode=TwoWay}"
Grid.Row="4"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Enable Delete key"
Grid.Row="5"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding EnableDeleteKey,Mode=TwoWay}"
Grid.Row="5"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Enable BackSpace key"
Grid.Row="6"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding EnableBackspaceKey,Mode=TwoWay}"
Grid.Row="6"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="OnFocus Behavior"
Grid.Row="7"
Grid.Column="0"/>
<ComboBox SelectedItem="{Binding OnFocusBehavior, Mode=TwoWay}"
Grid.Row="7"
Grid.Column="1"
Margin="3">
<syncfusion:OnFocusBehavior>CursorOnFirstCharacter</syncfusion:OnFocusBehavior>
<syncfusion:OnFocusBehavior>CursorAtEnd</syncfusion:OnFocusBehavior>
<syncfusion:OnFocusBehavior>Default</syncfusion:OnFocusBehavior>
</ComboBox>
<TextBlock Margin="3"
Text ="OnFocus Behavior"
Grid.Row="8"
Grid.Column="0"/>
<syncfusion:ColorPicker Brush="{Binding RepeatButtonBackground,Mode=TwoWay}"
IsEnabled="{Binding IsVisibleRepeatButton}"
Grid.Row="8"
Grid.Column="1"
Margin="3"/>
</Grid>
</GroupBox>
<!--Restrict the DateTime selection-->
<GroupBox Margin="10"
Grid.Column="1"
Height="150"
HeaderTemplate="{StaticResource GroupBox_Header}"
Header="Restrict the DateTime selection">
<Grid HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="3"
Text ="Set Minimum Date"
Grid.Row="0"
Grid.Column="0"/>
<syncfusion:DateTimeEdit DateTime="{Binding MinDateTime, Mode=TwoWay}"
Grid.Row="0"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Set Maximum Date"
Grid.Row="1"
Grid.Column="0"/>
<syncfusion:DateTimeEdit DateTime="{Binding MaxDateTime, Mode=TwoWay}"
Grid.Row="1"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Restrict date selection"
Grid.Row="2"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding DisableDateSelection,Mode=TwoWay}"
Grid.Row="2"
Grid.Column="1"
Margin="3"/>
<TextBlock Margin="3"
Text ="Readonly"
Grid.Row="3"
Grid.Column="0"/>
<CheckBox IsChecked="{Binding IsReadOnly,Mode=TwoWay}"
Grid.Row="3"
Grid.Column="1"
Margin="3"/>
</Grid>
</GroupBox>
</StackPanel>
</Grid>
</GroupBox>
</Grid>
</Window>