|
152 | 152 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
153 | 153 | </Grid.ColumnDefinitions>
|
154 | 154 | <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
155 |
| - <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
156 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" |
157 |
| - BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{DynamicResource MaterialDesignShadowDepth2}"> |
158 |
| - <Border x:Name="dropDownBorder" Background="Transparent"> |
| 155 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" UseLayoutRounding="True"> |
| 156 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" BorderThickness="1" |
| 157 | + Effect="{DynamicResource MaterialDesignShadowDepth2}" /> |
| 158 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 159 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
159 | 160 | <ScrollViewer x:Name="DropDownScrollViewer">
|
160 | 161 | <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
|
161 | 162 | <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
162 | 163 | <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
163 | 164 | </Canvas>
|
164 |
| - <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
165 |
| - /> |
| 165 | + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" UseLayoutRounding="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
166 | 166 | </Grid>
|
167 | 167 | </ScrollViewer>
|
168 | 168 | </Border>
|
169 |
| - </Border> |
| 169 | + </Grid> |
170 | 170 | </Popup>
|
171 | 171 | <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignDataGridComboBoxToggleButton}"
|
172 | 172 | />
|
|
230 | 230 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
231 | 231 | </Grid.ColumnDefinitions>
|
232 | 232 | <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
233 |
| - <Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}" |
234 |
| - CornerRadius="2" |
235 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{DynamicResource MaterialDesignShadowDepth2}"> |
236 |
| - <ScrollViewer x:Name="DropDownScrollViewer"> |
237 |
| - <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
238 |
| - <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
239 |
| - <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
240 |
| - </Canvas> |
241 |
| - <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
242 |
| - </Grid> |
243 |
| - </ScrollViewer> |
244 |
| - </Border> |
| 233 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" UseLayoutRounding="True"> |
| 234 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" BorderThickness="1" |
| 235 | + Effect="{DynamicResource MaterialDesignShadowDepth2}" /> |
| 236 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 237 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
| 238 | + <ScrollViewer x:Name="DropDownScrollViewer"> |
| 239 | + <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
| 240 | + <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
| 241 | + <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
| 242 | + </Canvas> |
| 243 | + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" UseLayoutRounding="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
| 244 | + </Grid> |
| 245 | + </ScrollViewer> |
| 246 | + </Border> |
| 247 | + </Grid> |
245 | 248 | </Popup>
|
246 | 249 | <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignDataGridComboBoxToggleButton}"/>
|
247 | 250 | <Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
|
|
260 | 263 | </Grid>
|
261 | 264 | <ControlTemplate.Triggers>
|
262 | 265 | <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
|
263 |
| - <Setter Property="Margin" TargetName="dropDownBorder" Value="5,5,5,5"/> |
| 266 | + <Setter Property="Margin" TargetName="shadow" Value="5,5,5,5"/> |
264 | 267 | </Trigger>
|
265 | 268 | <Trigger Property="IsEnabled" Value="false">
|
266 | 269 | <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
0 commit comments