Skip to content

Commit fae2af5

Browse files
authored
Fix BackGround of ComboBox (#1748)
* Fix #1728. Move CornerRadius Element. * fix BackGround of ComboBox * fix conflict
1 parent 6e20c00 commit fae2af5

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
</Border.Effect>
5656
</Border>
5757
<Border Margin="1"
58-
CornerRadius="{Binding Path=CornerRadius, RelativeSource={RelativeSource AncestorType=wpf:ComboBoxPopup}}"
59-
Background="{Binding ElementName=PART_Popup, Path=Background}">
58+
CornerRadius="{Binding Path=CornerRadius, RelativeSource={RelativeSource AncestorType=wpf:ComboBoxPopup}}" >
6059
<Grid SnapsToDevicePixels="True">
6160
<Grid.RowDefinitions>
6261
<RowDefinition Height="Auto"/>
@@ -65,21 +64,21 @@
6564
<RowDefinition Height="Auto"/>
6665
<RowDefinition Height="Auto"/>
6766
</Grid.RowDefinitions>
68-
<Border Grid.Row="0" Height="{StaticResource PopupTopBottomMargin}"/>
67+
<Border Grid.Row="0" Height="{StaticResource PopupTopBottomMargin}" Background="{Binding ElementName=PART_Popup, Path=Background}"/>
6968
<ContentPresenter Grid.Row="1"/>
70-
<Border Grid.Row="2" Height="{StaticResource PopupContentPresenterExtend}"/>
69+
<Border Grid.Row="2" Height="{StaticResource PopupContentPresenterExtend}" Background="{Binding ElementName=PART_Popup, Path=Background}"/>
7170

7271
<Grid Grid.Row="3">
7372
<Grid.ColumnDefinitions>
7473
<ColumnDefinition Width="Auto"/>
7574
<ColumnDefinition Width="Auto"/>
7675
<ColumnDefinition Width="*"/>
7776
</Grid.ColumnDefinitions>
78-
<Border Grid.Column="0" Width="{StaticResource PopupLeftRightMargin}"/>
77+
<Border Grid.Column="0" Width="{StaticResource PopupLeftRightMargin}" Background="{Binding ElementName=PART_Popup, Path=Background}"/>
7978
<Grid Grid.Column="1"
8079
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
8180
Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
82-
<Border Grid.Column="2" MinWidth="{StaticResource PopupLeftRightMargin}"/>
81+
<Border Grid.Column="2" MinWidth="{StaticResource PopupLeftRightMargin}" Background="{Binding ElementName=PART_Popup, Path=Background}"/>
8382
</Grid>
8483
<Border Grid.Row="4" Height="{StaticResource PopupTopBottomMargin}"/>
8584
</Grid>
@@ -102,8 +101,7 @@
102101
</Border.Effect>
103102
</Border>
104103
<Border Margin="1"
105-
CornerRadius="{Binding Path=CornerRadius, RelativeSource={RelativeSource AncestorType=wpf:ComboBoxPopup}}"
106-
Background="{Binding ElementName=PART_Popup, Path=Background}">
104+
CornerRadius="{Binding Path=CornerRadius, RelativeSource={RelativeSource AncestorType=wpf:ComboBoxPopup}}">
107105
<Grid SnapsToDevicePixels="True">
108106
<Grid.RowDefinitions>
109107
<RowDefinition Height="Auto"/>
@@ -113,28 +111,33 @@
113111
<RowDefinition Height="Auto"/>
114112
</Grid.RowDefinitions>
115113
<Border Grid.Row="0"
116-
Height="{StaticResource PopupTopBottomMargin}"/>
114+
Height="{StaticResource PopupTopBottomMargin}"
115+
Background="{Binding ElementName=PART_Popup, Path=Background}"/>
117116
<Grid Grid.Row="1">
118117
<Grid.ColumnDefinitions>
119118
<ColumnDefinition Width="Auto"/>
120119
<ColumnDefinition Width="Auto"/>
121120
<ColumnDefinition Width="*"/>
122121
</Grid.ColumnDefinitions>
123-
<Border Grid.Column="0"
122+
<Border Grid.Column="0"
123+
Background="{Binding ElementName=PART_Popup, Path=Background}"
124124
Width="{StaticResource PopupLeftRightMargin}"/>
125125
<Grid Grid.Column="1"
126126
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:ComboBoxPopup}}, Path=VisiblePlacementWidth}"
127127
Height="{Binding ElementName=templateRoot, Path=ActualHeight}"/>
128128
<Border Grid.Column="2"
129+
Background="{Binding ElementName=PART_Popup, Path=Background}"
129130
MinWidth="{StaticResource PopupLeftRightMargin}"/>
130131
</Grid>
131132

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

135137
<ContentPresenter Grid.Row="3"/>
136138

137139
<Border Grid.Row="4"
140+
Background="{Binding ElementName=PART_Popup, Path=Background}"
138141
Height="{StaticResource PopupTopBottomMargin}" />
139142
</Grid>
140143
</Border>
@@ -164,9 +167,13 @@
164167
<RowDefinition Height="*"/>
165168
<RowDefinition Height="Auto"/>
166169
</Grid.RowDefinitions>
167-
<Border Grid.Row="0" Height="{StaticResource PopupTopBottomMargin}"/>
170+
<Border Grid.Row="0"
171+
Height="{StaticResource PopupTopBottomMargin}"
172+
Background="{Binding ElementName=PART_Popup, Path=Background}" />
168173
<ContentPresenter Grid.Row="1"/>
169-
<Border Grid.Row="2" Height="{StaticResource PopupTopBottomMargin}" />
174+
<Border Grid.Row="2"
175+
Height="{StaticResource PopupTopBottomMargin}"
176+
Background="{Binding ElementName=PART_Popup, Path=Background}" />
170177
</Grid>
171178
</Border>
172179
</Grid>

0 commit comments

Comments
 (0)