-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathComboBox.xaml
797 lines (712 loc) · 47 KB
/
ComboBox.xaml
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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
<ResourceDictionary 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:toolkit="using:Uno.UI.Toolkit"
xmlns:um="using:Uno.Material"
xmlns:ut="using:Uno.Themes"
xmlns:xamarin="http://uno.ui/xamarin"
xmlns:uno="using:Uno.UI.Xaml.Controls"
mc:Ignorable="xamarin">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<!-- ComboBoxItem Brushes -->
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="OnSurfaceVariantHoverBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="OnSurfaceVariantHoverBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<!-- ComboBox Brushes -->
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="OutlineBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledBrush" />
<StaticResource x:Key="ComboBoxBorderBrushOpened" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundFocused" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundFocusedPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemPillFillBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundFocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundFocusedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocused" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxLeadingIconForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxLeadingIconForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxArrowForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxArrowForegroundOpened" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundFocused" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundFocusedPressed" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundOpened" ResourceKey="PrimaryBrush" />
<CornerRadius x:Key="ComboBoxCornerRadius">4</CornerRadius>
<x:Double x:Key="ComboBoxHeight">50</x:Double>
<x:Double x:Key="ComboBoxMinHeight">56</x:Double>
<x:Double x:Key="ComboBoxLeadingIconWidth">20</x:Double>
<x:Double x:Key="ComboBoxDownGlyphWidth">10</x:Double>
<x:Double x:Key="ComboBoxUpGlyphWidth">10</x:Double>
<x:Double x:Key="ComboBoxDownGlyphHeight">5</x:Double>
<x:Double x:Key="ComboBoxUpGlyphHeight">5</x:Double>
<Thickness x:Key="ComboBoxDownGlyphMargin">7,0</Thickness>
<Thickness x:Key="ComboBoxUpGlyphMargin">7,0</Thickness>
<Thickness x:Key="ComboBoxLeadingIconMargin">2,0,18,0</Thickness>
<Thickness x:Key="ComboBoxBorderThickness">1</Thickness>
<Thickness x:Key="ComboBoxOpenedBorderThickness">2</Thickness>
<Thickness x:Key="ComboBoxPadding">16,0</Thickness>
<Thickness x:Key="ComboBoxEditableTextPadding">0,5,38,6</Thickness>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<!-- ComboBoxItem Brushes -->
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="OnSurfaceVariantHoverBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="OnSurfaceVariantHoverBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="PrimarySelectedBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<!-- ComboBox Brushes -->
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="OutlineBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledBrush" />
<StaticResource x:Key="ComboBoxBorderBrushOpened" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundFocused" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundFocusedPressed" ResourceKey="SurfaceBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemPillFillBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundFocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundFocusedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="OnSurfaceBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocused" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxLeadingIconForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxLeadingIconForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxArrowForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxArrowForegroundOpened" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundFocused" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundFocusedPressed" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ComboBoxUpperPlaceHolderForegroundOpened" ResourceKey="PrimaryBrush" />
<CornerRadius x:Key="ComboBoxCornerRadius">4</CornerRadius>
<x:Double x:Key="ComboBoxHeight">50</x:Double>
<x:Double x:Key="ComboBoxMinHeight">56</x:Double>
<x:Double x:Key="ComboBoxLeadingIconWidth">20</x:Double>
<x:Double x:Key="ComboBoxDownGlyphWidth">10</x:Double>
<x:Double x:Key="ComboBoxUpGlyphWidth">10</x:Double>
<x:Double x:Key="ComboBoxDownGlyphHeight">5</x:Double>
<x:Double x:Key="ComboBoxUpGlyphHeight">5</x:Double>
<Thickness x:Key="ComboBoxDownGlyphMargin">7,0</Thickness>
<Thickness x:Key="ComboBoxUpGlyphMargin">7,0</Thickness>
<Thickness x:Key="ComboBoxLeadingIconMargin">2,0,18,0</Thickness>
<Thickness x:Key="ComboBoxBorderThickness">1</Thickness>
<Thickness x:Key="ComboBoxOpenedBorderThickness">2</Thickness>
<Thickness x:Key="ComboBoxPadding">16,0</Thickness>
<Thickness x:Key="ComboBoxEditableTextPadding">0,5,38,6</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<!-- Converters -->
<ut:FromNullToValueConverter x:Key="NullToContentTranslateYConverter"
NotNullValue="5"
NullValue="0" />
<ut:FromNullToValueConverter x:Key="NullToVisible"
NotNullValue="Collapsed"
NullValue="Visible" />
<ut:FromNullToValueConverter x:Key="NullToCollapsed"
NotNullValue="Visible"
NullValue="Collapsed" />
<!-- Path Data -->
<x:String x:Key="ComboBoxUpArrowPathData">M0 0L-5 -5L-10 0H0Z</x:String>
<x:String x:Key="ComboBoxDownArrowPathData">M0 0L5 5L10 0H0Z</x:String>
<!-- Style -->
<Style x:Key="MaterialComboBoxItemStyle"
TargetType="ComboBoxItem">
<Setter Property="Background" Value="{ThemeResource ComboBoxItemBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ComboBoxItemForeground}" />
<!-- Start: Body Large Typo -->
<Setter Property="FontFamily" Value="{ThemeResource BodyLargeFontFamily}" />
<Setter Property="FontWeight" Value="{ThemeResource BodyLargeFontWeight}" />
<Setter Property="FontSize" Value="{ThemeResource BodyLargeFontSize}" />
<Setter Property="CharacterSpacing" Value="{ThemeResource BodyLargeCharacterSpacing}" />
<!-- End: Body Large Typo -->
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Padding" Value="{ThemeResource ComboBoxPadding}" />
<Setter Property="Height" Value="{ThemeResource ComboBoxHeight}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Grid x:Name="RootGrid"
Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundPointerOver}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPointerOver}" />
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushPointerOver}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedOverlay"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="{StaticResource MaterialAnimationDuration}">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundPressed}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushPressed}" />
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushPressed}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedOverlay"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="{StaticResource MaterialAnimationDuration}">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Opacity" Value="1" />
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundDisabled}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundDisabled}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushDisabled}" />
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushDisabled}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundSelected}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelected}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushSelected}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedOverlay"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="{StaticResource MaterialAnimationDuration}">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedPointerOver">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundSelectedPointerOver}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPointerOver}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushSelectedPointerOver}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedOverlay"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="{StaticResource MaterialAnimationDuration}">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedDisabled">
<VisualState.Setters>
<Setter Target="ContentPresenter.Opacity" Value="1" />
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundSelectedDisabled}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedDisabled}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushSelectedDisabled}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="SelectedPressed">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundSelectedPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedPressed}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushSelectedPressed}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="PressedOverlay"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="{StaticResource MaterialAnimationDuration}">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseIn" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedUnfocused">
<VisualState.Setters>
<Setter Target="PressedOverlay.Background" Value="{ThemeResource ComboBoxItemBackgroundSelectedUnfocused}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxItemForegroundSelectedUnfocused}" />
<Setter Target="PressedOverlay.BorderBrush" Value="{ThemeResource ComboBoxItemBorderBrushSelectedUnfocused}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<!-- Pressed Overlay -->
<Grid x:Name="PressedOverlay"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{ThemeResource ComboBoxItemBackgroundSelected}"
IsHitTestVisible="False"
Opacity="0" />
<!-- ContentPresenter -->
<ContentPresenter x:Name="ContentPresenter"
Padding="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
ContentTransitions="{TemplateBinding ContentTransitions}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialComboBoxStyle"
TargetType="ComboBox">
<Setter Property="Foreground" Value="{ThemeResource ComboBoxForeground}" />
<Setter Property="Background" Value="{ThemeResource ComboBoxBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ComboBoxBorderThickness}" />
<Setter Property="Padding" Value="{ThemeResource ComboBoxPadding}" />
<Setter Property="TextBoxStyle" Value="{StaticResource MaterialComboBoxTextBoxStyle}" />
<!-- Start: Body Large Typo -->
<Setter Property="FontFamily" Value="{ThemeResource BodyLargeFontFamily}" />
<Setter Property="FontWeight" Value="{ThemeResource BodyLargeFontWeight}" />
<Setter Property="FontSize" Value="{ThemeResource BodyLargeFontSize}" />
<Setter Property="CharacterSpacing" Value="{ThemeResource BodyLargeCharacterSpacing}" />
<!-- End: Body Large Typo -->
<Setter Property="MinHeight" Value="{ThemeResource ComboBoxMinHeight}" />
<Setter Property="TabNavigation" Value="Once" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto" />
<Setter Property="ScrollViewer.IsVerticalRailEnabled" Value="True" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
<Setter Property="ScrollViewer.BringIntoViewOnFocusChange" Value="True" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialComboBoxItemStyle}" />
<xamarin:Setter Property="uno:ComboBox.DropDownPreferredPlacement"
Value="Below" />
<!-- Workaround for WinUI issue: https://github.com/microsoft/microsoft-ui-xaml/issues/6388 -->
<Setter Property="ut:ControlExtensions.Icon" Value="{x:Null}" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<CarouselPanel />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundDisabled}" />
<Setter Target="DropDownGlyph_Down.Fill" Value="{ThemeResource OnSurfaceLowBrush}" />
<Setter Target="PlaceholderTextBlock.Foreground" Value="{ThemeResource ComboBoxPlaceHolderForegroundDisabled}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundDisabled}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundDisabled}" />
<Setter Target="IconPresenter.Foreground" Value="{ThemeResource ComboBoxLeadingIconForegroundDisabled}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxBackgroundDisabled}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushDisabled}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundPointerOver}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxDropDownBackgroundPointerOver}" />
<Setter Target="PlaceholderTextBlock.Foreground" Value="{ThemeResource ComboBoxPlaceHolderForegroundPointerOver}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundPointerOver}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundPointerOver}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushPointerOver}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundPressed}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxDropDownBackgroundPressed}" />
<Setter Target="PlaceholderTextBlock.Foreground" Value="{ThemeResource ComboBoxPlaceHolderForegroundPressed}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundPressed}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushPressed}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="PointerFocused" />
<VisualState x:Name="FocusedDropDown" />
<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundFocused}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxDropDownBackgroundFocused}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundFocused}" />
<Setter Target="PlaceholderTextBlock.Foreground" Value="{ThemeResource ComboBoxPlaceHolderForegroundFocused}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundFocused}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundFocused}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushOpened}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource ComboBoxOpenedBorderThickness}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="FocusedPressed">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundFocusedPressed}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxDropDownBackgroundFocusedPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundFocusedPressed}" />
<Setter Target="PlaceholderTextBlock.Foreground" Value="{ThemeResource ComboBoxPlaceHolderForegroundFocusedPressed}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundFocusedPressed}" />
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ComboBoxForegroundFocusedPressed}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushOpened}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource ComboBoxOpenedBorderThickness}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unfocused">
<VisualState.Setters>
<Setter Target="ComboBoxContent.Background" Value="{ThemeResource ComboBoxBackgroundUnfocused}" />
<Setter Target="PopupBorder.Background" Value="{ThemeResource ComboBoxBackgroundUnfocused}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="DropDownStates">
<VisualState x:Name="Opened">
<VisualState.Setters>
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrushOpened}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource ComboBoxOpenedBorderThickness}" />
<Setter Target="UpperPlaceholderElement.Foreground" Value="{ThemeResource ComboBoxUpperPlaceHolderForegroundOpened}" />
<Setter Target="DropDownGlyph_Up.Fill" Value="{ThemeResource ComboBoxArrowForegroundOpened}" />
<Setter Target="DropDownGlyph_Down.Visibility" Value="Collapsed" />
<Setter Target="DropDownGlyph_Up.Visibility" Value="Visible" />
</VisualState.Setters>
<Storyboard>
<SplitOpenThemeAnimation ClosedLength="{Binding TemplateSettings.DropDownClosedHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ClosedTargetName="ContentPresenter"
ContentTargetName="ScrollViewer"
ContentTranslationOffset="0"
OffsetFromCenter="{Binding TemplateSettings.DropDownOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
OpenedLength="{Binding TemplateSettings.DropDownOpenedHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"
OpenedTargetName="PopupBorder" />
</Storyboard>
</VisualState>
<VisualState x:Name="Closed">
<VisualState.Setters>
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource ComboBoxBorderBrush}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource ComboBoxBorderThickness}" />
<Setter Target="DropDownGlyph_Down.Visibility" Value="Visible" />
<Setter Target="DropDownGlyph_Up.Visibility" Value="Collapsed" />
</VisualState.Setters>
<Storyboard>
<SplitCloseThemeAnimation ClosedLength="{Binding TemplateSettings.DropDownClosedHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ClosedTargetName="ContentPresenter"
ContentTargetName="ScrollViewer"
ContentTranslationDirection="{Binding TemplateSettings.SelectedItemDirection, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ContentTranslationOffset="40"
OffsetFromCenter="{Binding TemplateSettings.DropDownOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
OpenedLength="{Binding TemplateSettings.DropDownOpenedHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}"
OpenedTargetName="PopupBorder" />
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="EditableModeStates">
<VisualState x:Name="TextBoxFocused">
<VisualState.Setters>
<Setter Target="UpperPlaceholderElement.Visibility" Value="Visible" />
<Setter Target="PlaceholderTextBlock.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="TextBoxUnfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="ComboBoxContent"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
CornerRadius="{ThemeResource ComboBoxCornerRadius}">
<Grid.Resources>
<!-- Resources added here in order to manage the ContentPresenter TranslateY depending if there is a PlaceholderText or not -->
<CompositeTransform x:Key="ContentPresenter_CompositeTransformWithPlaceholder"
TranslateY="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToContentTranslateYConverter}, TargetNullValue=0, FallbackValue=0}" />
<CompositeTransform x:Key="ContentPresenter_CompositeTransformWithoutPlaceholder"
TranslateY="0" />
<ut:FromEmptyStringToValueConverter x:Key="EmptyToCompositeTransformConverter"
NotNullOrEmptyValue="{StaticResource ContentPresenter_CompositeTransformWithPlaceholder}"
NullOrEmptyValue="{StaticResource ContentPresenter_CompositeTransformWithoutPlaceholder}" />
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Leading Icon -->
<ContentPresenter x:Name="IconPresenter"
Width="{ThemeResource ComboBoxLeadingIconWidth}"
Margin="{ThemeResource ComboBoxLeadingIconMargin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{ThemeResource ComboBoxLeadingIconForeground}"
Content="{Binding Path=(ut:ControlExtensions.Icon), RelativeSource={RelativeSource TemplatedParent}}"
Visibility="{Binding Path=(ut:ControlExtensions.Icon), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToCollapsedConverter}, FallbackValue=Collapsed, TargetNullValue=Collapsed}" />
<!-- IsEditable -->
<TextBox x:Name="EditableText"
Grid.Column="1"
PlaceholderText="{TemplateBinding PlaceholderText}"
VerticalAlignment="Center"
Style="{TemplateBinding TextBoxStyle}"
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="Collapsed"
x:Load="False" />
<Border x:Name="DropDownOverlay"
Grid.Column="2"
Background="Transparent"
Margin="4,4,4,4"
Visibility="Collapsed"
CornerRadius="{StaticResource ComboBoxDropDownButtonBackgroundCornerRadius}"
Width="30"
HorizontalAlignment="Right"
x:Load="False" />
<!-- ContentPresenter -->
<ContentPresenter x:Name="ContentPresenter"
Grid.Column="1"
MaxLines="1"
VerticalAlignment="Center"
RenderTransform="{Binding PlaceholderText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource EmptyToCompositeTransformConverter}, TargetNullValue={StaticResource ContentPresenter_CompositeTransformWithoutPlaceholder}, FallbackValue={StaticResource ContentPresenter_CompositeTransformWithoutPlaceholder}}" />
<!-- PlaceholderElement -->
<TextBlock x:Name="PlaceholderTextBlock"
Grid.Column="1"
VerticalAlignment="Center"
Visibility="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToVisible}, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
Foreground="{ThemeResource ComboBoxPlaceHolderForeground}"
IsHitTestVisible="False"
MaxLines="1"
RenderTransformOrigin="0,0.5"
Style="{StaticResource BodyLarge}"
Text="{TemplateBinding PlaceholderText}" />
<TextBlock x:Name="UpperPlaceholderElement"
Grid.Column="1"
VerticalAlignment="Center"
Visibility="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToCollapsed}, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
Foreground="{ThemeResource ComboBoxUpperPlaceHolderForeground}"
IsHitTestVisible="False"
MaxLines="1"
RenderTransformOrigin="0,0.5"
Style="{StaticResource BodyLarge}"
Text="{TemplateBinding PlaceholderText}">
<TextBlock.RenderTransform>
<CompositeTransform x:Name="UpperPlaceholderElement_CompositeTransform"
ScaleX="0.7"
ScaleY="0.7"
TranslateY="-11" />
</TextBlock.RenderTransform>
</TextBlock>
<!-- Down -->
<Path x:Name="DropDownGlyph_Down"
Grid.Column="2"
Width="{ThemeResource ComboBoxDownGlyphWidth}"
Height="{ThemeResource ComboBoxDownGlyphHeight}"
Margin="{ThemeResource ComboBoxDownGlyphMargin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{StaticResource ComboBoxDownArrowPathData}"
Fill="{ThemeResource ComboBoxArrowForeground}"
Stretch="Uniform" />
<!-- Up -->
<Path x:Name="DropDownGlyph_Up"
Grid.Column="2"
Width="{ThemeResource ComboBoxUpGlyphWidth}"
Height="{ThemeResource ComboBoxUpGlyphHeight}"
Margin="{ThemeResource ComboBoxUpGlyphMargin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{StaticResource ComboBoxUpArrowPathData}"
Fill="{ThemeResource ComboBoxArrowForeground}"
Stretch="Uniform"
Visibility="Collapsed" />
</Grid>
<!--
In Figma design, border thickness doesn't push its inner content like on xaml.
So we are putting the border as an overlay here. To keep the rest of the measurements/values identical to Figma.
-->
<Border x:Name="BorderBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{ThemeResource ComboBoxCornerRadius}" />
<!-- Popup -->
<Popup x:Name="Popup">
<Border x:Name="PopupBorder"
CornerRadius="{ThemeResource ComboBoxCornerRadius}"
Background="{ThemeResource ComboBoxDropDownBackground}">
<!-- Workaround for Issue #213 where android PopupBorder doesn't get redrawn properly, adds Background, CornerRadius and Border to ScrollViewer -->
<ScrollViewer x:Name="ScrollViewer"
MinWidth="{ThemeResource ComboBoxPopupThemeMinWidth}"
AutomationProperties.AccessibilityView="Raw"
BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}"
CornerRadius="{ThemeResource ComboBoxCornerRadius}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
VerticalSnapPointsAlignment="Near"
VerticalSnapPointsType="OptionalSingle"
ZoomMode="Disabled"
Foreground="{ThemeResource ComboBoxDropDownForeground}"
BorderBrush="{ThemeResource ComboBoxDropDownBorderBrush}">
<ItemsPresenter />
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialComboBoxTextBoxStyle"
BasedOn="{StaticResource MaterialOutlinedTextBoxStyle}"
TargetType="TextBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{ThemeResource ComboBoxForeground}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid Background="{TemplateBinding Background}">
<Grid.Resources>
<Thickness x:Key="WithoutPlaceholderOffset">0,18,0,0</Thickness>
<Thickness x:Key="WithPlaceholderOffset">0,23,0,0</Thickness>
<ut:FromEmptyStringToValueConverter x:Key="HasPlaceholderToContentOffsetConverter"
NotNullOrEmptyValue="{StaticResource WithPlaceholderOffset}"
NullOrEmptyValue="{StaticResource WithoutPlaceholderOffset}" />
</Grid.Resources>
<ScrollViewer x:Name="ContentElement"
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="False"
ZoomMode="Disabled"
AutomationProperties.AccessibilityView="Raw"
Padding="{Binding PlaceholderText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource HasPlaceholderToContentOffsetConverter}, TargetNullValue={StaticResource WithoutPlaceholderOffset}, FallbackValue={StaticResource WithoutPlaceholderOffset}}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialDefaultComboBoxStyle"
TargetType="ComboBox"
BasedOn="{StaticResource MaterialComboBoxStyle}" />
</ResourceDictionary>