|
26 | 26 | </Setter.Value>
|
27 | 27 | </Setter>
|
28 | 28 | </Style>
|
29 |
| - |
30 |
| - <system:Double x:Key="PopupContentPresenterExtend">4</system:Double> |
31 |
| - <system:Double x:Key="PopupTopBottomMargin">8</system:Double> |
| 29 | + |
32 | 30 | <system:Double x:Key="PopupLeftRightMargin">16</system:Double>
|
33 | 31 |
|
34 | 32 | <ControlTemplate x:Key="PopupContentUpTemplate" TargetType="ContentControl">
|
35 |
| - <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}" |
| 33 | + <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter={x:Static wpf:ComboBoxPopup.LeftRightMargin}}" |
36 | 34 | Margin="6">
|
37 | 35 | <Grid.RowDefinitions>
|
38 | 36 | <RowDefinition Height="*" />
|
|
55 | 53 | </Grid.RowDefinitions>
|
56 | 54 | <Border Grid.Row="0"
|
57 | 55 | CornerRadius="2 2 0 0"
|
58 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" |
59 |
| - Height="{StaticResource PopupTopBottomMargin}"/> |
| 56 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
| 57 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}"/> |
60 | 58 | <ContentPresenter Grid.Row="1"/>
|
61 |
| - <Rectangle Grid.Row="2" |
62 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}" |
63 |
| - Height="{StaticResource PopupContentPresenterExtend}"/> |
| 59 | + <Border Grid.Row="2" |
| 60 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
| 61 | + Height="{x:Static wpf:ComboBoxPopup.ContentPresenterExtend}"/> |
64 | 62 |
|
65 | 63 | <Grid Grid.Row="3">
|
66 | 64 | <Grid.ColumnDefinitions>
|
67 | 65 | <ColumnDefinition Width="Auto"/>
|
68 | 66 | <ColumnDefinition Width="Auto"/>
|
69 | 67 | <ColumnDefinition Width="*"/>
|
70 | 68 | </Grid.ColumnDefinitions>
|
71 |
| - <Rectangle Grid.Column="0" |
72 |
| - Width="{StaticResource PopupLeftRightMargin}" |
73 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}"/> |
| 69 | + <Border Grid.Column="0" |
| 70 | + Width="{StaticResource PopupLeftRightMargin}" |
| 71 | + Background="{Binding ElementName=PART_Popup, Path=Background}"/> |
74 | 72 | <Grid Grid.Column="1"
|
75 | 73 | Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
|
76 | 74 | Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
|
77 |
| - <Rectangle Grid.Column="2" |
78 |
| - MinWidth="{StaticResource PopupLeftRightMargin}" |
79 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}"/> |
| 75 | + <Border Grid.Column="2" |
| 76 | + MinWidth="{StaticResource PopupLeftRightMargin}" |
| 77 | + Background="{Binding ElementName=PART_Popup, Path=Background}"/> |
80 | 78 | </Grid>
|
81 | 79 |
|
82 | 80 | <Border Grid.Row="4"
|
83 | 81 | CornerRadius="0 0 2 2"
|
84 |
| - Height="{StaticResource PopupTopBottomMargin}" |
85 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" /> |
| 82 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}" |
| 83 | + Background="{Binding ElementName=PART_Popup, Path=Background}" /> |
86 | 84 | </Grid>
|
87 | 85 | </Grid>
|
88 | 86 | </ControlTemplate>
|
89 | 87 |
|
90 | 88 | <ControlTemplate x:Key="PopupContentDownTemplate" TargetType="ContentControl">
|
91 |
| - <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}" |
| 89 | + <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter={x:Static wpf:ComboBoxPopup.LeftRightMargin}}" |
92 | 90 | Margin="6">
|
93 | 91 | <Grid.RowDefinitions>
|
94 | 92 | <RowDefinition Height="*" />
|
|
112 | 110 | </Grid.RowDefinitions>
|
113 | 111 | <Border Grid.Row="0"
|
114 | 112 | CornerRadius="2 2 0 0"
|
115 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" |
116 |
| - Height="{StaticResource PopupTopBottomMargin}"/> |
| 113 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
| 114 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}"/> |
117 | 115 |
|
118 | 116 | <Grid Grid.Row="1">
|
119 | 117 | <Grid.ColumnDefinitions>
|
120 | 118 | <ColumnDefinition Width="Auto"/>
|
121 | 119 | <ColumnDefinition Width="Auto"/>
|
122 | 120 | <ColumnDefinition Width="*"/>
|
123 | 121 | </Grid.ColumnDefinitions>
|
124 |
| - <Rectangle Grid.Column="0" |
125 |
| - Width="{StaticResource PopupLeftRightMargin}" |
126 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}" |
| 122 | + <Border Grid.Column="0" |
| 123 | + Width="{StaticResource PopupLeftRightMargin}" |
| 124 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
127 | 125 | />
|
128 | 126 | <Grid Grid.Column="1"
|
129 | 127 | Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
|
130 | 128 | Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
|
131 |
| - <Rectangle Grid.Column="2" |
132 |
| - MinWidth="{StaticResource PopupLeftRightMargin}" |
133 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}" |
| 129 | + <Border Grid.Column="2" |
| 130 | + MinWidth="{StaticResource PopupLeftRightMargin}" |
| 131 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
134 | 132 | />
|
135 | 133 | </Grid>
|
136 | 134 |
|
137 |
| - <Rectangle Grid.Row="2" |
138 |
| - Fill="{Binding ElementName=templateRoot, Path=Background}" |
139 |
| - Height="{StaticResource PopupContentPresenterExtend}"/> |
| 135 | + <Border Grid.Row="2" |
| 136 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
| 137 | + Height="{x:Static wpf:ComboBoxPopup.ContentPresenterExtend}"/> |
140 | 138 |
|
141 | 139 | <ContentPresenter Grid.Row="3"/>
|
142 | 140 |
|
143 | 141 | <Border Grid.Row="4"
|
144 | 142 | CornerRadius="0 0 2 2"
|
145 |
| - Height="{StaticResource PopupTopBottomMargin}" |
146 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" /> |
| 143 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}" |
| 144 | + Background="{Binding ElementName=PART_Popup, Path=Background}" /> |
147 | 145 | </Grid>
|
148 | 146 | </Grid>
|
149 | 147 | </ControlTemplate>
|
150 | 148 |
|
151 | 149 | <ControlTemplate x:Key="PopupContentDefaultTemplate" TargetType="ContentControl">
|
152 |
| - <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter=32}" |
| 150 | + <Grid MinWidth="{Binding ElementName=templateRoot, Path=ActualWidth, Converter={StaticResource MathAddConverter}, ConverterParameter={x:Static wpf:ComboBoxPopup.LeftRightMargin}}" |
153 | 151 | Margin="6">
|
154 | 152 | <Grid.RowDefinitions>
|
155 | 153 | <RowDefinition Height="*" />
|
|
170 | 168 | </Grid.RowDefinitions>
|
171 | 169 | <Border Grid.Row="0"
|
172 | 170 | CornerRadius="2 2 0 0"
|
173 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" |
174 |
| - Height="{StaticResource PopupTopBottomMargin}"/> |
| 171 | + Background="{Binding ElementName=PART_Popup, Path=Background}" |
| 172 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}"/> |
175 | 173 |
|
176 | 174 | <ContentPresenter Grid.Row="1"/>
|
177 | 175 |
|
178 | 176 | <Border Grid.Row="2"
|
179 | 177 | CornerRadius="0 0 2 2"
|
180 |
| - Height="{StaticResource PopupTopBottomMargin}" |
181 |
| - Background="{Binding ElementName=templateRoot, Path=Background}" /> |
| 178 | + Height="{x:Static wpf:ComboBoxPopup.TopBottomMargin}" |
| 179 | + Background="{Binding ElementName=PART_Popup, Path=Background}" /> |
182 | 180 | </Grid>
|
183 | 181 | </Grid>
|
184 | 182 | </ControlTemplate>
|
|
441 | 439 | Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/>
|
442 | 440 |
|
443 | 441 | <wpf:ComboBoxPopup x:Name="PART_Popup"
|
444 |
| - AllowsTransparency="true" |
445 |
| - Focusable="False" |
446 |
| - HorizontalOffset="-11.5" |
447 |
| - IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
448 |
| - PlacementTarget="{Binding ElementName=templateRoot}" |
449 |
| - SnapsToDevicePixels="True" |
450 |
| - UseLayoutRounding="True" |
451 |
| - Placement="Custom" |
452 |
| - PopupAnimation="Fade" |
453 |
| - VerticalOffset="0" |
454 |
| - DefaultVerticalOffset="5" |
455 |
| - DownVerticalOffset="-15.5" |
456 |
| - UpVerticalOffset="15" |
457 |
| - UpContentTemplate="{StaticResource PopupContentUpTemplate}" |
458 |
| - DownContentTemplate="{StaticResource PopupContentDownTemplate}" |
459 |
| - DefaultContentTemplate="{StaticResource PopupContentDefaultTemplate}"> |
| 442 | + AllowsTransparency="true" |
| 443 | + Focusable="False" |
| 444 | + HorizontalOffset="-11.5" |
| 445 | + IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
| 446 | + PlacementTarget="{Binding ElementName=templateRoot}" |
| 447 | + SnapsToDevicePixels="True" |
| 448 | + UseLayoutRounding="True" |
| 449 | + Placement="Custom" |
| 450 | + PopupAnimation="Fade" |
| 451 | + VerticalOffset="0" |
| 452 | + DefaultVerticalOffset="5" |
| 453 | + DownVerticalOffset="-15.5" |
| 454 | + UpVerticalOffset="15" |
| 455 | + UpContentTemplate="{StaticResource PopupContentUpTemplate}" |
| 456 | + DownContentTemplate="{StaticResource PopupContentDownTemplate}" |
| 457 | + DefaultContentTemplate="{StaticResource PopupContentDefaultTemplate}"> |
460 | 458 | <ContentControl>
|
461 | 459 | <ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
462 |
| - Background="{TemplateBinding Background}"> |
| 460 | + Background="{Binding Background, ElementName=PART_Popup}"> |
463 | 461 | <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
|
464 | 462 | </ScrollViewer>
|
465 | 463 | </ContentControl>
|
|
522 | 520 |
|
523 | 521 | <Style x:Key="MaterialDesignComboBox" TargetType="{x:Type ComboBox}">
|
524 | 522 | <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
525 |
| - <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}"/> |
| 523 | + <Setter Property="Background" Value="Transparent"/> |
526 | 524 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}"/>
|
527 | 525 | <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
|
528 | 526 | <Setter Property="BorderThickness" Value="0 0 0 1"/>
|
|
0 commit comments