aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml
blob: c5fbb1971348bf98f2a8ff307e326a6429d9ea5a (plain)
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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"
                    xmlns:system="clr-namespace:System;assembly=mscorlib"
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
                    xmlns:materialdesign="clr-namespace:MaterialDesignThemes.Wpf">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" IsNotEmptyValue="Collapsed" />
    <converters:MathConverter x:Key="MathAddConverter" Operation="Add" />
    <converters:BrushRoundConverter x:Key="BrushRoundConverter" />
    <converters:BooleanToVisibilityConverter x:Key="InverseBoolToVisConverter" TrueValue="Collapsed" FalseValue="Visible"/>
    
    <system:Double x:Key="PopupContentPresenterExtend">4</system:Double>
    <system:Double x:Key="PopupTopBottomMargin">8</system:Double>
    <system:Double x:Key="PopupLeftRightMargin">16</system:Double>
    <system:Boolean x:Key="TrueValue">True</system:Boolean>
    <system:Boolean x:Key="FalseValue">False</system:Boolean>

    <Style x:Key="FocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Margin="2 2 2 2"
                               SnapsToDevicePixels="true"
                               Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                               StrokeDashArray="1 2"
                               StrokeThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="PopupContentUpTemplate" TargetType="ContentControl">
        <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}"
              Margin="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Border Background="Transparent"
                    BorderBrush="{DynamicResource MaterialDesignShadowBrush}"
                    BorderThickness="1"
                    CornerRadius="2">
                <Border.Effect>
                    <BlurEffect Radius="6"/>
                </Border.Effect>
            </Border>
            <Grid Margin="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0"
                        CornerRadius="2 2 0 0"
                        Background="{Binding ElementName=PART_Popup, Path=Background}"
                        Height="{StaticResource PopupTopBottomMargin}"/>
                <ContentPresenter Grid.Row="1"/>
                <Border Grid.Row="2"
                        Background="{Binding ElementName=PART_Popup, Path=Background}"
                        Height="{StaticResource PopupContentPresenterExtend}"/>

                <Grid Grid.Row="3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Border Grid.Column="0"
                            Width="{StaticResource PopupLeftRightMargin}"
                           Background="{Binding ElementName=PART_Popup, Path=Background}"/>
                    <Grid Grid.Column="1"
                          Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
                          Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
                    <Border Grid.Column="2"
                            MinWidth="{StaticResource PopupLeftRightMargin}"
                            Background="{Binding ElementName=PART_Popup, Path=Background}"/>
                </Grid>

                <Border Grid.Row="4"
                        CornerRadius="0 0 2 2"
                        Height="{StaticResource PopupTopBottomMargin}"
                        Background="{Binding ElementName=PART_Popup, Path=Background}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="PopupContentDownTemplate" TargetType="ContentControl">
        <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}"
              Margin="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Border Background="Transparent"
                    BorderBrush="{DynamicResource MaterialDesignShadowBrush}"
                    BorderThickness="1"
                    CornerRadius="2">
                <Border.Effect>
                    <BlurEffect Radius="6"/>
                </Border.Effect>
            </Border>
            <Grid Margin="1"
                  SnapsToDevicePixels="True">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0"
                        CornerRadius="2 2 0 0"
                        Background="{Binding ElementName=PART_Popup, Path=Background}"
                        Height="{StaticResource PopupTopBottomMargin}"/>

                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Border Grid.Column="0"
                            Width="{StaticResource PopupLeftRightMargin}"
                            Background="{Binding ElementName=PART_Popup, Path=Background}"
                               />
                    <Grid Grid.Column="1"
                          Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
                          Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
                    <Border Grid.Column="2"
                            MinWidth="{StaticResource PopupLeftRightMargin}"
                            Background="{Binding ElementName=PART_Popup, Path=Background}"
                               />
                </Grid>

                <Border Grid.Row="2"
                        Background="{Binding ElementName=PART_Popup, Path=Background}"
                        Height="{StaticResource PopupContentPresenterExtend}"/>

                <ContentPresenter Grid.Row="3"/>

                <Border Grid.Row="4"
                        CornerRadius="0 0 2 2"
                        Height="{StaticResource PopupTopBottomMargin}"
                        Background="{Binding ElementName=PART_Popup, Path=Background}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="PopupContentClassicTemplate" TargetType="ContentControl">
        <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}"
              Margin="6">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Border Background="Transparent"
                    BorderBrush="{DynamicResource MaterialDesignShadowBrush}"
                    BorderThickness="1"
                    CornerRadius="2">
                <Border.Effect>
                    <BlurEffect Radius="6"/>
                </Border.Effect>
            </Border>
            <Grid Margin="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0"
                        CornerRadius="2 2 0 0"
                        Background="{Binding ElementName=PART_Popup, Path=Background}"
                        Height="{StaticResource PopupTopBottomMargin}"/>

                <ContentPresenter Grid.Row="1"/>

                <Border Grid.Row="2"
                        CornerRadius="0 0 2 2"
                        Height="{StaticResource PopupTopBottomMargin}"
                        Background="{Binding ElementName=PART_Popup, Path=Background}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <Style x:Key="MaterialDesignComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="MinHeight" Value="0" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <ScrollViewer x:Name="PART_ContentHost"
                                      Focusable="false"
                                      HorizontalScrollBarVisibility="Hidden"
                                      VerticalScrollBarVisibility="Hidden" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="MaterialDesignComboBoxItemTemplate" TargetType="{x:Type ComboBoxItem}">
        <Grid x:Name="GridWrapper">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0:0:0.3" To="Normal">
                            <VisualTransition.GeneratedEasingFunction>
                                <CircleEase EasingMode="EaseOut" />
                            </VisualTransition.GeneratedEasingFunction>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                    <VisualState Name="Normal" />
                    <VisualState Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="MouseOverBorder"
                                             Storyboard.TargetProperty="Opacity"
                                             To="0.1" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup Name="SelectionStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0:0:0.3" />
                    </VisualStateGroup.Transitions>
                    <VisualState Name="Selected">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="SelectedBorder"
                                             Storyboard.TargetProperty="Opacity"
                                             To="0.18" />
                        </Storyboard>
                    </VisualState>
                    <VisualState Name="Unselected" />
                </VisualStateGroup>
                <VisualStateGroup Name="FocusStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0:0:0.3" To="Unfocused" />
                    </VisualStateGroup.Transitions>
                    <VisualState Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="MouseOverBorder"
                                             Storyboard.TargetProperty="Opacity"
                                             To="0.1" />
                        </Storyboard>
                    </VisualState>
                    <VisualState Name="Unfocused" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="BackBorder"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    SnapsToDevicePixels="true" />

            <Border x:Name="MouseOverBorder"
                    Background="{TemplateBinding Foreground,
                                                 Converter={StaticResource BrushRoundConverter}}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0"
                    SnapsToDevicePixels="true" />
            <Border x:Name="SelectedBorder"
                    Background="{TemplateBinding Foreground,
                                                 Converter={StaticResource BrushRoundConverter}}"
                    Opacity="0"
                    RenderTransformOrigin="0.5,0.5" />
            <wpf:Ripple HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                        Feedback="{TemplateBinding Foreground,
                                                   Converter={StaticResource BrushRoundConverter}}"
                        Focusable="False"
                        Padding="{TemplateBinding Padding}"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="GridWrapper" Property="Opacity" Value="0.56" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Tag" Value="1.0" />
                    <Condition Property="IsSelected" Value="True" />
                </MultiTrigger.Conditions>
                <Setter Property="Height" Value="0"/>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="MaterialDesignComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Padding" Value="16 8" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
        <Setter Property="Template" Value="{StaticResource MaterialDesignComboBoxItemTemplate}" />
    </Style>

    <Style x:Key="MaterialDesignComboBoxItemSelectedCollapsedStyle"
           BasedOn="{StaticResource MaterialDesignComboBoxItemStyle}"
           TargetType="{x:Type ComboBoxItem}">
        <Setter Property="Tag" Value="1.0" />
    </Style>

    <Style x:Key="MaterialDesignComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="ClickMode" Value="Press" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Border x:Name="ToggleTemplateRoot"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <Border x:Name="splitBorder"
                                    Margin="0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    BorderBrush="Transparent"
                                    BorderThickness="0">
                                <Path x:Name="arrow"
                                              Width="8" Height="8"
                                              Margin="0"
                                              Stretch="Uniform"
                                              HorizontalAlignment="Right"
                                              VerticalAlignment="Center"
                                              Data="M7,10L12,15L17,10H7Z"
                                              Fill="{TemplateBinding BorderBrush}" />
                            </Border>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" />
                            </MultiDataTrigger.Conditions>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
                        </MultiDataTrigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="arrow" Property="Fill" Value="{DynamicResource PrimaryHueDarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="arrow" Property="Fill" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
                        </Trigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="ToggleTemplateRoot" Property="BorderBrush" Value="Transparent"/>
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
                                <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="ToggleTemplateRoot" Property="BorderBrush" Value="Transparent"/>
                            <Setter TargetName="splitBorder" Property="BorderBrush" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" />
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="MaterialDesignFloatingHintComboBoxTemplate" TargetType="{x:Type ComboBox}">
        <Grid x:Name="templateRoot"
              Background="{TemplateBinding Background}"
              SnapsToDevicePixels="True">
            <Grid x:Name="InnerRoot">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
                </Grid.ColumnDefinitions>
                <ToggleButton x:Name="toggleButton"
                              Grid.ColumnSpan="2"
                              Background="{TemplateBinding Background}"
                              BorderBrush="{TemplateBinding BorderBrush}"
                              BorderThickness="{TemplateBinding BorderThickness}"
                              IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                              Style="{StaticResource MaterialDesignComboBoxToggleButton}"/>
                <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                      Margin="{TemplateBinding Padding}"
                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                      UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
                    <Grid x:Name="InputRoot"
                          HorizontalAlignment="Left">
                        <ContentPresenter x:Name="contentPresenter"
                                          Content="{TemplateBinding SelectionBoxItem}"
                                          ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
                                          ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                          ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                          IsHitTestVisible="False"/>
                        <TextBox x:Name="PART_EditableTextBox"
                                 IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
                                 HorizontalAlignment="Left"
                                 HorizontalContentAlignment="Stretch"
                                 Style="{StaticResource MaterialDesignComboBoxEditableTextBox}"
                                 CaretBrush="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}"                                 
                                 Visibility="Collapsed" />

                        <wpf:SmartHint x:Name="Hint"
                                       HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
                                       FontSize="{TemplateBinding FontSize}"
                                       SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                       UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
                                       UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
                                       HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                                       Hint="{TemplateBinding wpf:HintAssist.Hint}" />
                    </Grid>
                </Grid>
                <Line x:Name="DashedLine" Grid.ColumnSpan="2" VerticalAlignment="Bottom"
                      Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Converter={StaticResource InverseBoolToVisConverter}}"
                      StrokeThickness="1.25" StrokeDashArray="1,2.5" StrokeDashCap="Round"
                      X1="0" X2="{Binding ActualWidth, ElementName=toggleButton}" Y1="0" Y2="0" 
                      Stroke="{TemplateBinding BorderBrush}" Opacity="0.56" />
                <wpf:Underline x:Name="Underline"
                               Grid.ColumnSpan="2"
                               IsActive="{Binding ElementName=PART_EditableTextBox, Path=IsKeyboardFocused}"
                               Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/>

                <wpf:ComboBoxPopup x:Name="PART_Popup"
                                   AllowsTransparency="true"
                                   Focusable="False"
                                   HorizontalOffset="-11.5"
                                   IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                   PlacementTarget="{Binding ElementName=templateRoot}"
                                   SnapsToDevicePixels="True"
                                   UseLayoutRounding="True"
                                   Placement="Custom"
                                   PopupAnimation="Fade"
                                   VerticalOffset="0"
                                   DefaultVerticalOffset="5"
                                   DownVerticalOffset="-15.5"
                                   UpVerticalOffset="15"
                                   ClassicMode="{Binding Path=(wpf:ComboBoxAssist.ClassicMode), RelativeSource={RelativeSource TemplatedParent}}"
                                   UpContentTemplate="{StaticResource PopupContentUpTemplate}"
                                   DownContentTemplate="{StaticResource PopupContentDownTemplate}"
                                   ClassicContentTemplate="{StaticResource PopupContentClassicTemplate}">
                    <ContentControl>
                        <ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                      Background="{Binding Background, ElementName=PART_Popup}">
                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
                        </ScrollViewer>
                    </ContentControl>
                </wpf:ComboBoxPopup>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger SourceName="PART_Popup" Property="PopupPlacement" Value="{x:Static materialdesign:ComboBoxPopupPlacement.Classic}">
                <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemStyle}" />
            </Trigger>
            <Trigger SourceName="PART_Popup" Property="IsOpen" Value="True">
                <Setter Property="Background" TargetName="templateRoot" Value="{Binding Background, ElementName=PART_Popup}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="templateRoot" Property="Opacity" Value="0.56"/>
                <Setter TargetName="toggleButton" Property="BorderBrush" Value="Transparent"/>
            </Trigger>
            <Trigger Property="IsEditable" Value="True">
                <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
                <Setter TargetName="Underline" Property="Visibility" Value="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" />
                <Setter TargetName="contentPresenter" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="wpf:HintAssist.IsFloating" Value="True">
                <Setter TargetName="InnerRoot" Property="Margin" Value="0 11.5 0 0" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsEditable" Value="False"/>
                    <Condition Property="IsDropDownOpen" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter TargetName="Underline" Property="Visibility" Value="Hidden"/>
                <Setter TargetName="toggleButton" Property="BorderBrush" Value="Transparent"/>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" />
                    <Condition Property="wpf:HintAssist.IsFloating" Value="True" />
                    <Condition Property="IsKeyboardFocusWithin" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
                <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="wpf:HintAssist.IsFloating" Value="True" />
                    <Condition SourceName="Hint" Property="IsHintInFloatingPosition" Value="True" />
                    <Condition Property="IsKeyboardFocusWithin" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
                <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" />
                    <Condition SourceName="PART_EditableTextBox" Property="IsKeyboardFocused" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
                <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" />
                    <Condition Property="IsDropDownOpen" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
                <Setter TargetName="Hint" Property="HintOpacity" Value="1" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true" />
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
            </MultiTrigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter TargetName="Underline" Property="IsActive" Value="True"/>
            </Trigger>
            <Trigger Property="Validation.HasError" Value="true">
                <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
                <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="true" />
                    <Condition Property="Validation.HasError" Value="true" />
                </MultiTrigger.Conditions>
                <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
                <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="true" />
                    <Condition Property="Validation.HasError" Value="false" />
                </MultiTrigger.Conditions>
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
                <Setter TargetName="Underline" Property="Background" Value="{DynamicResource PrimaryHueMidBrush}"/>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="MaterialDesignComboBox" TargetType="{x:Type ComboBox}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}"/>
        <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
        <Setter Property="BorderThickness" Value="0 0 0 1"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemSelectedCollapsedStyle}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Padding" Value="0 6 0 6" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
        <Setter Property="ScrollViewer.PanningMode" Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
        <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="1 0 1 0" />
        <Setter Property="Template" Value="{StaticResource MaterialDesignFloatingHintComboBoxTemplate}" />
        <Style.Triggers>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="true">
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
            </Trigger>
            <Trigger Property="IsEditable" Value="true">
                <Setter Property="IsTabStop" Value="false" />
                <!-- designer prefers hard bool -->
                <Setter Property="wpf:ComboBoxAssist.ShowSelectedItem" Value="{StaticResource TrueValue}" />
            </Trigger>
            <!-- designer prefers hard bool -->
            <Trigger Property="wpf:ComboBoxAssist.ShowSelectedItem" Value="{StaticResource TrueValue}" >
                <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemStyle}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MaterialDesignFloatingHintComboBox"
           BasedOn="{StaticResource MaterialDesignComboBox}"
           TargetType="{x:Type ComboBox}">
        <Setter Property="wpf:HintAssist.IsFloating" Value="True"/>
    </Style>

</ResourceDictionary>