Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ public class MessageBox : System.Windows.Window
/// <summary>Identifies the <see cref="PrimaryButtonIcon"/> dependency property.</summary>
public static readonly DependencyProperty PrimaryButtonIconProperty = DependencyProperty.Register(
nameof(PrimaryButtonIcon),
typeof(SymbolRegular),
typeof(IconElement),
typeof(MessageBox),
new PropertyMetadata(SymbolRegular.Empty)
new PropertyMetadata(null)
);

/// <summary>Identifies the <see cref="SecondaryButtonIcon"/> dependency property.</summary>
public static readonly DependencyProperty SecondaryButtonIconProperty = DependencyProperty.Register(
nameof(SecondaryButtonIcon),
typeof(SymbolRegular),
typeof(IconElement),
typeof(MessageBox),
new PropertyMetadata(SymbolRegular.Empty)
new PropertyMetadata(null)
);

/// <summary>Identifies the <see cref="CloseButtonIcon"/> dependency property.</summary>
public static readonly DependencyProperty CloseButtonIconProperty = DependencyProperty.Register(
nameof(CloseButtonIcon),
typeof(SymbolRegular),
typeof(IconElement),
typeof(MessageBox),
new PropertyMetadata(SymbolRegular.Empty)
new PropertyMetadata(null)
);

/// <summary>Identifies the <see cref="PrimaryButtonAppearance"/> dependency property.</summary>
Expand Down Expand Up @@ -158,27 +158,27 @@ public string CloseButtonText
/// <summary>
/// Gets or sets the <see cref="SymbolRegular"/> on the primary button
/// </summary>
public SymbolRegular PrimaryButtonIcon
public IconElement? PrimaryButtonIcon
{
get => (SymbolRegular)GetValue(PrimaryButtonIconProperty);
get => (IconElement?)GetValue(PrimaryButtonIconProperty);
set => SetValue(PrimaryButtonIconProperty, value);
}

/// <summary>
/// Gets or sets the <see cref="SymbolRegular"/> on the secondary button
/// </summary>
public SymbolRegular SecondaryButtonIcon
public IconElement? SecondaryButtonIcon
{
get => (SymbolRegular)GetValue(SecondaryButtonIconProperty);
get => (IconElement?)GetValue(SecondaryButtonIconProperty);
set => SetValue(SecondaryButtonIconProperty, value);
}

/// <summary>
/// Gets or sets the <see cref="SymbolRegular"/> on the close button
/// </summary>
public SymbolRegular CloseButtonIcon
public IconElement? CloseButtonIcon
{
get => (SymbolRegular)GetValue(CloseButtonIconProperty);
get => (IconElement?)GetValue(CloseButtonIconProperty);
set => SetValue(CloseButtonIconProperty, value);
}

Expand Down
5 changes: 4 additions & 1 deletion src/Wpf.Ui/Controls/MessageBox/MessageBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageBox}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Primary}"
Content="{TemplateBinding PrimaryButtonText}"
Icon="{TemplateBinding PrimaryButtonIcon}"
IsDefault="True" />

<controls:Button
Expand All @@ -114,7 +115,8 @@
Appearance="{TemplateBinding SecondaryButtonAppearance}"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageBox}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Secondary}"
Content="{TemplateBinding SecondaryButtonText}" />
Content="{TemplateBinding SecondaryButtonText}"
Icon="{TemplateBinding SecondaryButtonIcon}" />

<controls:Button
Grid.Column="4"
Expand All @@ -123,6 +125,7 @@
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageBox}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Close}"
Content="{TemplateBinding CloseButtonText}"
Icon="{TemplateBinding CloseButtonIcon}"
IsCancel="True" />
</Grid>
</Border>
Expand Down