Skip to content

Commit afd7c17

Browse files
Add corner radius for PopupBox (#2625)
1 parent 0bb56b1 commit afd7c17

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

MaterialDesignThemes.Wpf/PopupBox.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,21 @@ public double PopupVerticalOffset
344344
set => SetValue(PopupVerticalOffsetProperty, value);
345345
}
346346

347+
/// <summary>
348+
/// Get or sets the corner radius of the popup card.
349+
/// </summary>
350+
public static readonly DependencyProperty PopupUniformCornerRadiusProperty = DependencyProperty.Register(
351+
nameof(PopupUniformCornerRadius), typeof(double), typeof(PopupBox), new PropertyMetadata(default(double)));
352+
353+
/// <summary>
354+
/// Get or sets the corner radius of the popup card.
355+
/// </summary>
356+
public double PopupUniformCornerRadius
357+
{
358+
get => (double)GetValue(PopupUniformCornerRadiusProperty);
359+
set => SetValue(PopupUniformCornerRadiusProperty, value);
360+
}
361+
347362
/// <summary>
348363
/// Framework use. Provides the method used to position the popup.
349364
/// </summary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.PopupBox.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<Setter Property="TextElement.FontWeight" Value="Normal" />
7676
<Setter Property="Padding" Value="0 8 0 8" />
7777
<Setter Property="Focusable" Value="True" />
78+
<Setter Property="PopupUniformCornerRadius" Value="2"/>
7879
<Setter Property="Template">
7980
<Setter.Value>
8081
<ControlTemplate TargetType="{x:Type wpf:PopupBox}">
@@ -114,6 +115,7 @@
114115
Foreground="{DynamicResource MaterialDesignBody}"
115116
Padding="{TemplateBinding Padding}"
116117
RenderOptions.ClearTypeHint="Enabled"
118+
UniformCornerRadius="{TemplateBinding PopupUniformCornerRadius}"
117119
Margin="5">
118120
<wpf:Card.Resources>
119121
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignPopupBoxButton}" />

0 commit comments

Comments
 (0)