11
11
mc : Ignorable =" d"
12
12
d : DesignHeight =" 300"
13
13
d : DesignWidth =" 600"
14
- d : DataContext =" {d:DesignInstance colorsDomain:FieldsViewModel , IsDesignTimeCreatable=False}" >
14
+ d : DataContext =" {d:DesignInstance colorsDomain:ComboBoxesViewModel , IsDesignTimeCreatable=False}" >
15
15
16
16
<UserControl .Resources>
17
17
<Style x : Key =" SectionTitle" TargetType =" TextBlock" BasedOn =" {StaticResource MaterialDesignHeadline5TextBlock }" >
18
18
<Setter Property =" Margin" Value =" 0 24 0 0" />
19
19
</Style >
20
-
20
+
21
21
<Style TargetType =" {x:Type smtx:XamlDisplay}" BasedOn =" {StaticResource {x:Type smtx:XamlDisplay}}" >
22
22
<Setter Property =" Margin" Value =" 16 0 0 0" />
23
23
<Setter Property =" VerticalAlignment" Value =" Bottom" />
249
249
<TextBlock
250
250
Style =" {StaticResource SectionTitle}"
251
251
Text =" Filled ComboBox" />
252
-
253
- <smtx : XamlDisplay
254
- UniqueKey =" comboboxes_filled_combobox"
255
- HorizontalAlignment =" Left"
256
- Margin =" 0 16 0 0" >
257
252
258
- <StackPanel >
259
- <Grid >
260
- <Grid .ColumnDefinitions>
261
- <ColumnDefinition />
262
- <ColumnDefinition />
263
- </Grid .ColumnDefinitions>
264
- <CheckBox
265
- x : Name =" MaterialDesignFilledComboBoxEnabledComboBox"
266
- IsChecked =" True"
267
- Margin =" 0,0,0,8"
268
- Content =" Enabled" />
253
+ <StackPanel
254
+ Orientation =" Horizontal"
255
+ Margin =" 0,8,0,0" >
256
+ <smtx : XamlDisplay
257
+ UniqueKey =" comboboxes_filled_combobox"
258
+ HorizontalAlignment =" Left" >
259
+
260
+ <StackPanel >
261
+ <Grid >
262
+ <Grid .ColumnDefinitions>
263
+ <ColumnDefinition />
264
+ <ColumnDefinition />
265
+ </Grid .ColumnDefinitions>
266
+ <CheckBox
267
+ x : Name =" FilledComboBoxEnabledCheckBox"
268
+ IsChecked =" True"
269
+ Margin =" 0,0,0,8"
270
+ Content =" Enabled" />
271
+
272
+ <Button
273
+ Content =" Clear"
274
+ Style =" {StaticResource MaterialDesignFlatButton}"
275
+ HorizontalAlignment =" Right"
276
+ Grid.Column=" 1"
277
+ Click =" ClearFilledComboBox_Click" />
278
+ </Grid >
279
+
280
+ <ComboBox
281
+ x : Name =" FilledComboBox"
282
+ Style =" {StaticResource MaterialDesignFilledComboBox}"
283
+ IsEnabled =" {Binding Path=IsChecked, ElementName=FilledComboBoxEnabledCheckBox}"
284
+ materialDesign:HintAssist.Hint=" Some item"
285
+ Width =" 256" >
286
+ <ComboBoxItem Content =" Item 1" />
287
+ <ComboBoxItem Content =" Item 2" />
288
+ <ComboBoxItem Content =" Item 3" />
289
+ </ComboBox >
290
+ </StackPanel >
291
+ </smtx : XamlDisplay >
292
+
293
+ <smtx : XamlDisplay
294
+ UniqueKey =" comboboxes_validation_filled_combobox"
295
+ HorizontalAlignment =" Left" >
296
+ <ComboBox
297
+ Style =" {StaticResource MaterialDesignFilledComboBox}"
298
+ materialDesign:HintAssist.Hint=" Validation test"
299
+ ItemsSource =" {Binding ShortStringList}"
300
+ materialDesign:TextFieldAssist.HasClearButton=" True"
301
+ Width =" 256" >
302
+ <ComboBox .SelectedItem>
303
+ <Binding
304
+ Path =" SelectedValidationFilled"
305
+ Mode =" TwoWay"
306
+ UpdateSourceTrigger =" PropertyChanged" >
307
+ <Binding .ValidationRules>
308
+ <demoAppDomain : NotEmptyValidationRule ValidatesOnTargetUpdated =" True" />
309
+ </Binding .ValidationRules>
310
+ </Binding >
311
+ </ComboBox .SelectedItem>
312
+ </ComboBox >
313
+ </smtx : XamlDisplay >
314
+ </StackPanel >
315
+
316
+ <TextBlock
317
+ Style =" {StaticResource SectionTitle}"
318
+ Text =" Outlined ComboBox" />
319
+
320
+ <StackPanel
321
+ Orientation =" Horizontal"
322
+ Margin =" 0,8,0,0" >
323
+ <smtx : XamlDisplay
324
+ UniqueKey =" comboboxes_outlined_combobox"
325
+ HorizontalAlignment =" Left" >
326
+
327
+ <StackPanel >
328
+ <Grid >
329
+ <Grid .ColumnDefinitions>
330
+ <ColumnDefinition />
331
+ <ColumnDefinition />
332
+ </Grid .ColumnDefinitions>
333
+ <CheckBox
334
+ x : Name =" OutlinedComboBoxEnabledCheckBox"
335
+ IsChecked =" True"
336
+ Margin =" 0,0,0,8"
337
+ Content =" Enabled" />
338
+
339
+ <Button
340
+ Content =" Clear"
341
+ Style =" {StaticResource MaterialDesignFlatButton}"
342
+ HorizontalAlignment =" Right"
343
+ Grid.Column=" 1"
344
+ Click =" ClearOutlinedComboBox_Click" />
345
+ </Grid >
269
346
270
- <Button
271
- Content =" Clear"
272
- Style =" {StaticResource MaterialDesignFlatButton}"
273
- HorizontalAlignment =" Right"
274
- Grid.Column=" 1"
275
- Click =" ClearFilledComboBox_Click" />
276
- </Grid >
277
-
347
+ <ComboBox
348
+ x : Name =" OutlinedComboBox"
349
+ Style =" {StaticResource MaterialDesignOutlinedComboBox}"
350
+ IsEnabled =" {Binding Path=IsChecked, ElementName=OutlinedComboBoxEnabledCheckBox}"
351
+ materialDesign:HintAssist.Hint=" Some item"
352
+ ItemsSource =" {Binding ShortStringList}"
353
+ Width =" 256" />
354
+ </StackPanel >
355
+ </smtx : XamlDisplay >
356
+
357
+ <smtx : XamlDisplay
358
+ UniqueKey =" comboboxes_validation_outlined_combobox"
359
+ HorizontalAlignment =" Left" >
278
360
<ComboBox
279
- x : Name = " FilledComboBox "
280
- Style = " {StaticResource MaterialDesignFilledComboBox} "
281
- IsEnabled =" {Binding Path=IsChecked, ElementName=MaterialDesignFilledComboBoxEnabledComboBox }"
282
- materialDesign:HintAssist.Hint= " Some item "
361
+ Style = " {StaticResource MaterialDesignOutlinedComboBox} "
362
+ materialDesign:HintAssist.Hint= " Validation test "
363
+ ItemsSource =" {Binding ShortStringList }"
364
+ materialDesign:TextFieldAssist.HasClearButton= " True "
283
365
Width =" 256" >
284
- <ComboBoxItem Content =" Item 1" />
285
- <ComboBoxItem Content =" Item 2" />
286
- <ComboBoxItem Content =" Item 3" />
366
+ <ComboBox .SelectedItem>
367
+ <Binding
368
+ Path =" SelectedValidationOutlined"
369
+ Mode =" TwoWay"
370
+ UpdateSourceTrigger =" PropertyChanged" >
371
+ <Binding .ValidationRules>
372
+ <demoAppDomain : NotEmptyValidationRule ValidatesOnTargetUpdated =" True" />
373
+ </Binding .ValidationRules>
374
+ </Binding >
375
+ </ComboBox .SelectedItem>
287
376
</ComboBox >
288
- </StackPanel >
289
- </smtx : XamlDisplay >
377
+ </smtx : XamlDisplay >
378
+ </StackPanel >
290
379
</StackPanel >
291
380
</UserControl >
0 commit comments