diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
index 0e37bcb1e..fb241e195 100644
--- a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
+++ b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
@@ -115,6 +115,14 @@ public class MessageBox : System.Windows.Window
new PropertyMetadata(true)
);
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty IsCloseButtonEnabledProperty = DependencyProperty.Register(
+ nameof(IsCloseButtonEnabled),
+ typeof(bool),
+ typeof(MessageBox),
+ new PropertyMetadata(true)
+ );
+
/// Identifies the dependency property.
public static readonly DependencyProperty TemplateButtonCommandProperty = DependencyProperty.Register(
nameof(TemplateButtonCommand),
@@ -214,7 +222,16 @@ public ControlAppearance CloseButtonAppearance
}
///
- /// Gets or sets a value indicating whether the primary button is enabled.
+ /// Gets or sets a value indicating whether the close button is enabled.
+ ///
+ public bool IsCloseButtonEnabled
+ {
+ get => (bool)GetValue(IsCloseButtonEnabledProperty);
+ set => SetValue(IsCloseButtonEnabledProperty, value);
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the secondary button is enabled.
///
public bool IsSecondaryButtonEnabled
{
@@ -223,7 +240,7 @@ public bool IsSecondaryButtonEnabled
}
///
- /// Gets or sets a value indicating whether the secondary button is enabled.
+ /// Gets or sets a value indicating whether the primary button is enabled.
///
public bool IsPrimaryButtonEnabled
{
diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBox.xaml b/src/Wpf.Ui/Controls/MessageBox/MessageBox.xaml
index de5f9245a..7686262ad 100644
--- a/src/Wpf.Ui/Controls/MessageBox/MessageBox.xaml
+++ b/src/Wpf.Ui/Controls/MessageBox/MessageBox.xaml
@@ -15,6 +15,7 @@
+
@@ -84,7 +85,7 @@
+
@@ -152,6 +154,10 @@
+
+
+
+