|
158 | 158 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
159 | 159 | </Grid.ColumnDefinitions>
|
160 | 160 | <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">
|
161 |
| - <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
162 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" |
163 |
| - BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{StaticResource MaterialDesignShadowDepth2}"> |
164 |
| - <Border x:Name="dropDownBorder" Background="Transparent"> |
| 161 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" > |
| 162 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
| 163 | + Effect="{StaticResource MaterialDesignShadowDepth2}" /> |
| 164 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 165 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
165 | 166 | <ScrollViewer x:Name="DropDownScrollViewer">
|
166 | 167 | <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
|
167 | 168 | <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
|
172 | 173 | </Grid>
|
173 | 174 | </ScrollViewer>
|
174 | 175 | </Border>
|
175 |
| - </Border> |
| 176 | + </Grid> |
176 | 177 | </Popup>
|
177 | 178 | <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 MaterialDesignComboBoxToggleButton}"
|
178 | 179 | />
|
|
261 | 262 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
262 | 263 | </Grid.ColumnDefinitions>
|
263 | 264 | <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">
|
264 |
| - <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
265 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" |
266 |
| - BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{StaticResource MaterialDesignShadowDepth2}"> |
267 |
| - <Border x:Name="dropDownBorder" Background="Transparent"> |
| 265 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"> |
| 266 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
| 267 | + Effect="{StaticResource MaterialDesignShadowDepth2}" /> |
| 268 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 269 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
268 | 270 | <ScrollViewer x:Name="DropDownScrollViewer">
|
269 | 271 | <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
|
270 | 272 | <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
|
275 | 277 | </Grid>
|
276 | 278 | </ScrollViewer>
|
277 | 279 | </Border>
|
278 |
| - </Border> |
| 280 | + </Grid> |
279 | 281 | </Popup>
|
280 | 282 | <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 MaterialDesignComboBoxToggleButton}"
|
281 | 283 | />
|
|
356 | 358 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
357 | 359 | </Grid.ColumnDefinitions>
|
358 | 360 | <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
359 |
| - <Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}" |
360 |
| - CornerRadius="2" |
361 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{StaticResource MaterialDesignShadowDepth2}"> |
362 |
| - <ScrollViewer x:Name="DropDownScrollViewer"> |
363 |
| - <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
364 |
| - <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
365 |
| - <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
366 |
| - </Canvas> |
367 |
| - <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
368 |
| - </Grid> |
369 |
| - </ScrollViewer> |
370 |
| - </Border> |
| 361 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"> |
| 362 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
| 363 | + Effect="{StaticResource MaterialDesignShadowDepth2}" /> |
| 364 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 365 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
| 366 | + <ScrollViewer x:Name="DropDownScrollViewer"> |
| 367 | + <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
| 368 | + <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
| 369 | + <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
| 370 | + </Canvas> |
| 371 | + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 372 | + /> |
| 373 | + </Grid> |
| 374 | + </ScrollViewer> |
| 375 | + </Border> |
| 376 | + </Grid> |
371 | 377 | </Popup>
|
372 | 378 | <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 MaterialDesignComboBoxToggleButton}"/>
|
373 | 379 | <Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
|
|
387 | 393 | </Grid>
|
388 | 394 | <ControlTemplate.Triggers>
|
389 | 395 | <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
|
390 |
| - <Setter Property="Margin" TargetName="dropDownBorder" Value="5,5,5,5"/> |
| 396 | + <Setter Property="Margin" TargetName="shadow" Value="5,5,5,5"/> |
391 | 397 | </Trigger>
|
392 | 398 | <Trigger Property="IsEnabled" Value="false">
|
393 | 399 | <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
461 | 467 | <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
462 | 468 | </Grid.ColumnDefinitions>
|
463 | 469 | <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
464 |
| - <Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}" |
465 |
| - CornerRadius="2" |
466 |
| - MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{StaticResource MaterialDesignShadowDepth2}"> |
467 |
| - <ScrollViewer x:Name="DropDownScrollViewer"> |
468 |
| - <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
469 |
| - <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
470 |
| - <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
471 |
| - </Canvas> |
472 |
| - <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
473 |
| - </Grid> |
474 |
| - </ScrollViewer> |
475 |
| - </Border> |
| 470 | + <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"> |
| 471 | + <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2" |
| 472 | + Effect="{StaticResource MaterialDesignShadowDepth2}" /> |
| 473 | + <Border x:Name="dropDownBorder" Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}" Background="Transparent" |
| 474 | + CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}"> |
| 475 | + <ScrollViewer x:Name="DropDownScrollViewer"> |
| 476 | + <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> |
| 477 | + <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
| 478 | + <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> |
| 479 | + </Canvas> |
| 480 | + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 481 | + /> |
| 482 | + </Grid> |
| 483 | + </ScrollViewer> |
| 484 | + </Border> |
| 485 | + </Grid> |
476 | 486 | </Popup>
|
477 | 487 | <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 MaterialDesignComboBoxToggleButton}"
|
478 | 488 | Margin="0 14 0 0"/>
|
|
512 | 522 | <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
|
513 | 523 | </MultiTrigger>
|
514 | 524 | <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
|
515 |
| - <Setter Property="Margin" TargetName="dropDownBorder" Value="5,5,5,5"/> |
| 525 | + <Setter Property="Margin" TargetName="shadow" Value="5,5,5,5"/> |
516 | 526 | </Trigger>
|
517 | 527 | <Trigger Property="IsEnabled" Value="false">
|
518 | 528 | <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
0 commit comments