1
- <UserControl x : Class =" MaterialDesignDemo.ComboBoxes"
1
+ <UserControl x : Class =" MaterialDesignDemo.ComboBoxes"
2
2
xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
3
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
4
4
xmlns : colorsDomain =" clr-namespace:MaterialDesignDemo.Domain"
7
7
xmlns : materialDesign =" http://materialdesigninxaml.net/winfx/xaml/themes"
8
8
xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
9
9
xmlns : smtx =" clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
10
+ xmlns : converters =" clr-namespace:MaterialDesignDemo.Converters"
11
+ xmlns : materialDesignDemo =" clr-namespace:MaterialDesignDemo"
10
12
d : DataContext =" {d:DesignInstance colorsDomain:ComboBoxesViewModel,
11
13
IsDesignTimeCreatable=False}"
12
14
d : DesignHeight =" 300"
339
341
</ComboBox >
340
342
</smtx : XamlDisplay >
341
343
</StackPanel >
344
+
345
+ <TextBlock Style =" {StaticResource SectionTitle}" Text =" Rotation Clockwise" />
346
+
347
+ <StackPanel Margin =" 0,8,0,0" >
348
+ <CheckBox x : Name =" CheckBoxClockwiseRotateContent" IsChecked =" False" Content =" Rotate drop-down content" Margin =" 16,0" />
349
+ <StackPanel Margin =" 16,15,0,0" Orientation =" Horizontal" >
350
+
351
+ <smtx : XamlDisplay UniqueKey =" clockwise_1" Margin =" 0" >
352
+ <ComboBox Style =" {StaticResource MaterialDesignFloatingHintComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
353
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesClockWiseCallback}" >
354
+ <ComboBox .LayoutTransform>
355
+ <RotateTransform Angle =" 90" />
356
+ </ComboBox .LayoutTransform>
357
+ <ComboBox .ItemsPanel>
358
+ <ItemsPanelTemplate >
359
+ <StackPanel Orientation =" Vertical" >
360
+ <StackPanel .LayoutTransform>
361
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=-90, FalseValue=0}}" />
362
+ </StackPanel .LayoutTransform>
363
+ </StackPanel >
364
+ </ItemsPanelTemplate >
365
+ </ComboBox .ItemsPanel>
366
+ <ComboBoxItem Content =" Item 1" />
367
+ <ComboBoxItem Content =" Item 2" />
368
+ <ComboBoxItem Content =" Item 3" />
369
+ <ComboBoxItem Content =" Item 4" />
370
+ </ComboBox >
371
+ </smtx : XamlDisplay >
372
+
373
+ <smtx : XamlDisplay UniqueKey =" clockwise_2" Margin =" 150,0" >
374
+ <ComboBox Style =" {StaticResource MaterialDesignFilledComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
375
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesClockWiseCallback}" >
376
+ <ComboBox .LayoutTransform>
377
+ <RotateTransform Angle =" 90" />
378
+ </ComboBox .LayoutTransform>
379
+ <ComboBox .ItemsPanel>
380
+ <ItemsPanelTemplate >
381
+ <StackPanel Orientation =" Vertical" >
382
+ <StackPanel .LayoutTransform>
383
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=-90, FalseValue=0}}" />
384
+ </StackPanel .LayoutTransform>
385
+ </StackPanel >
386
+ </ItemsPanelTemplate >
387
+ </ComboBox .ItemsPanel>
388
+ <ComboBoxItem Content =" Item 1" />
389
+ <ComboBoxItem Content =" Item 2" />
390
+ <ComboBoxItem Content =" Item 3" />
391
+ <ComboBoxItem Content =" Item 4" />
392
+ </ComboBox >
393
+ </smtx : XamlDisplay >
394
+
395
+ <smtx : XamlDisplay UniqueKey =" clockwise_3" Margin =" 0" >
396
+ <ComboBox Style =" {StaticResource MaterialDesignOutlinedComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
397
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesClockWiseCallback}" >
398
+ <ComboBox .LayoutTransform>
399
+ <RotateTransform Angle =" 90" />
400
+ </ComboBox .LayoutTransform>
401
+ <ComboBox .ItemsPanel>
402
+ <ItemsPanelTemplate >
403
+ <StackPanel Orientation =" Vertical" >
404
+ <StackPanel .LayoutTransform>
405
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=-90, FalseValue=0}}" />
406
+ </StackPanel .LayoutTransform>
407
+ </StackPanel >
408
+ </ItemsPanelTemplate >
409
+ </ComboBox .ItemsPanel>
410
+ <ComboBoxItem Content =" Item 1" />
411
+ <ComboBoxItem Content =" Item 2" />
412
+ <ComboBoxItem Content =" Item 3" />
413
+ <ComboBoxItem Content =" Item 4" />
414
+ </ComboBox >
415
+ </smtx : XamlDisplay >
416
+
417
+ </StackPanel >
418
+ </StackPanel >
419
+
420
+ <TextBlock Style =" {StaticResource SectionTitle}" Text =" Rotation Counter-Clockwise" />
421
+
422
+ <StackPanel Margin =" 0,8,0,0" >
423
+ <CheckBox x : Name =" CheckBoxCounterClockwiseRotateContent" IsChecked =" False" Content =" Rotate drop-down content" Margin =" 16,0" />
424
+ <StackPanel Margin =" 16,15,0,0" Orientation =" Horizontal" >
425
+
426
+ <smtx : XamlDisplay UniqueKey =" counter_clockwise_1" Margin =" 0" >
427
+ <ComboBox Style =" {StaticResource MaterialDesignFloatingHintComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
428
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesCounterClockWiseCallback}" >
429
+ <ComboBox .LayoutTransform>
430
+ <RotateTransform Angle =" -90" />
431
+ </ComboBox .LayoutTransform>
432
+ <ComboBox .ItemsPanel>
433
+ <ItemsPanelTemplate >
434
+ <StackPanel Orientation =" Vertical" >
435
+ <StackPanel .LayoutTransform>
436
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxCounterClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=90, FalseValue=0}}" />
437
+ </StackPanel .LayoutTransform>
438
+ </StackPanel >
439
+ </ItemsPanelTemplate >
440
+ </ComboBox .ItemsPanel>
441
+ <ComboBoxItem Content =" Item 1" />
442
+ <ComboBoxItem Content =" Item 2" />
443
+ <ComboBoxItem Content =" Item 3" />
444
+ <ComboBoxItem Content =" Item 4" />
445
+ </ComboBox >
446
+ </smtx : XamlDisplay >
447
+
448
+ <smtx : XamlDisplay UniqueKey =" counter_clockwise_2" Margin =" 150,0" >
449
+ <ComboBox Style =" {StaticResource MaterialDesignFilledComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
450
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesCounterClockWiseCallback}" >
451
+ <ComboBox .LayoutTransform>
452
+ <RotateTransform Angle =" -90" />
453
+ </ComboBox .LayoutTransform>
454
+ <ComboBox .ItemsPanel>
455
+ <ItemsPanelTemplate >
456
+ <StackPanel Orientation =" Vertical" >
457
+ <StackPanel .LayoutTransform>
458
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxCounterClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=90, FalseValue=0}}" />
459
+ </StackPanel .LayoutTransform>
460
+ </StackPanel >
461
+ </ItemsPanelTemplate >
462
+ </ComboBox .ItemsPanel>
463
+ <ComboBoxItem Content =" Item 1" />
464
+ <ComboBoxItem Content =" Item 2" />
465
+ <ComboBoxItem Content =" Item 3" />
466
+ <ComboBoxItem Content =" Item 4" />
467
+ </ComboBox >
468
+ </smtx : XamlDisplay >
469
+
470
+ <smtx : XamlDisplay UniqueKey =" counter_clockwise_3" Margin =" 0" >
471
+ <ComboBox Style =" {StaticResource MaterialDesignOutlinedComboBox}" Width =" 150" materialDesign:HintAssist.Hint=" Selected Item"
472
+ materialDesign:ComboBoxAssist.CustomPopupPlacementCallback=" {x:Static materialDesignDemo:ComboBoxes.Rotate90DegreesCounterClockWiseCallback}" >
473
+ <ComboBox .LayoutTransform>
474
+ <RotateTransform Angle =" -90" />
475
+ </ComboBox .LayoutTransform>
476
+ <ComboBox .ItemsPanel>
477
+ <ItemsPanelTemplate >
478
+ <StackPanel Orientation =" Vertical" >
479
+ <StackPanel .LayoutTransform>
480
+ <RotateTransform Angle =" {Binding ElementName=CheckBoxCounterClockwiseRotateContent, Path=IsChecked, Converter={converters:BooleanToDoubleConverter TrueValue=90, FalseValue=0}}" />
481
+ </StackPanel .LayoutTransform>
482
+ </StackPanel >
483
+ </ItemsPanelTemplate >
484
+ </ComboBox .ItemsPanel>
485
+ <ComboBoxItem Content =" Item 1" />
486
+ <ComboBoxItem Content =" Item 2" />
487
+ <ComboBoxItem Content =" Item 3" />
488
+ <ComboBoxItem Content =" Item 4" />
489
+ </ComboBox >
490
+ </smtx : XamlDisplay >
491
+
492
+ </StackPanel >
493
+ </StackPanel >
494
+
342
495
</StackPanel >
343
- </UserControl >
496
+ </UserControl >
0 commit comments