diff --git a/src/Dialogs/DialogBase.cs b/src/Dialogs/DialogBase.cs
index 07a3b89..9efbc1e 100644
--- a/src/Dialogs/DialogBase.cs
+++ b/src/Dialogs/DialogBase.cs
@@ -14,346 +14,347 @@
using wpf_material_dialogs.Interfaces;
using HorizontalAlignment = System.Windows.HorizontalAlignment;
-namespace wpf_material_dialogs.Dialogs;
-
-///
-/// Class DialogBase.
-/// Implements the
-///
-///
-public abstract class DialogBase : IDialog
+namespace wpf_material_dialogs.Dialogs
{
- private readonly object buttonLock = new();
- private readonly List buttonTypes = new();
- private HorizontalAlignment buttonAlignment = HorizontalAlignment.Right;
- private IButtons buttons = new OkButtons();
- private DialogButton dialogButtons = DialogButton.OkButtons;
- private FontWeight fontWeight = FontWeights.Normal;
- private double height = double.NaN;
- private Brush iconBrush;
- private PackIconKind iconKind;
- private bool showIcon;
- private string text;
- private double textFontSize = 14;
- private string title;
- private double titleFontSize = 16;
- private FontWeight titleFontWeight = FontWeights.Bold;
- private double width = double.NaN;
-
///
- /// Gets the selected buttons based on the selection.
+ /// Class DialogBase.
+ /// Implements the
///
- /// .
- public IButtons SelectedButtons => DialogButtons == DialogButton.Custom
- ? Buttons
- : GetButtons(DialogButtons);
-
- public FontWeight TitleFontWeight
+ ///
+ public abstract class DialogBase : IDialog
{
- get => titleFontWeight;
- set
+ private readonly object buttonLock = new();
+ private readonly List buttonTypes = new();
+ private HorizontalAlignment buttonAlignment = HorizontalAlignment.Right;
+ private IButtons buttons = new OkButtons();
+ private DialogButton dialogButtons = DialogButton.OkButtons;
+ private FontWeight fontWeight = FontWeights.Normal;
+ private double height = double.NaN;
+ private Brush iconBrush;
+ private PackIconKind iconKind;
+ private bool showIcon;
+ private string text;
+ private double textFontSize = 14;
+ private string title;
+ private double titleFontSize = 16;
+ private FontWeight titleFontWeight = FontWeights.Bold;
+ private double width = double.NaN;
+
+ ///
+ /// Gets the selected buttons based on the selection.
+ ///
+ /// .
+ public IButtons SelectedButtons => DialogButtons == DialogButton.Custom
+ ? Buttons
+ : GetButtons(DialogButtons);
+
+ public FontWeight TitleFontWeight
{
- titleFontWeight = value;
- NotifyOfPropertyChanged();
+ get => titleFontWeight;
+ set
+ {
+ titleFontWeight = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- public FontWeight FontWeight
- {
- get => fontWeight;
- set
+ public FontWeight FontWeight
{
- fontWeight = value;
- NotifyOfPropertyChanged();
+ get => fontWeight;
+ set
+ {
+ fontWeight = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- public double Width
- {
- get => width;
- set
+ public double Width
{
- width = value;
- NotifyOfPropertyChanged();
+ get => width;
+ set
+ {
+ width = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- public double Height
- {
- get => height;
- set
+ public double Height
{
- height = value;
- NotifyOfPropertyChanged();
+ get => height;
+ set
+ {
+ height = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Gets or sets the button alignment.
- ///
- /// .
- public HorizontalAlignment ButtonAlignment
- {
- get => buttonAlignment;
- set
+ ///
+ /// Gets or sets the button alignment.
+ ///
+ /// .
+ public HorizontalAlignment ButtonAlignment
{
- buttonAlignment = value;
- NotifyOfPropertyChanged();
+ get => buttonAlignment;
+ set
+ {
+ buttonAlignment = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Gets or sets the custom buttons to be used. must set to custom for this property to
- /// apply.
- ///
- /// .
- public IButtons Buttons
- {
- get => buttons;
- set
+ ///
+ /// Gets or sets the custom buttons to be used. must set to custom for this property to
+ /// apply.
+ ///
+ /// .
+ public IButtons Buttons
{
- buttons = value;
- NotifyOfPropertyChanged();
+ get => buttons;
+ set
+ {
+ buttons = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Gets or sets the buttons to use in the dialog.
- ///
- /// .
- public DialogButton DialogButtons
- {
- get => dialogButtons;
- set
+ ///
+ /// Gets or sets the buttons to use in the dialog.
+ ///
+ /// .
+ public DialogButton DialogButtons
{
- dialogButtons = value;
- NotifyOfPropertyChanged();
+ get => dialogButtons;
+ set
+ {
+ dialogButtons = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Gets the buttons.
- ///
- /// The button enum to convert to an IButton.
- /// IButtons.
- /// button
- /// button
- /// button
- public IButtons GetButtons(DialogButton button)
- {
- lock (buttonLock)
+ ///
+ /// Gets the buttons.
+ ///
+ /// The button enum to convert to an IButton.
+ /// IButtons.
+ /// button
+ /// button
+ /// button
+ public IButtons GetButtons(DialogButton button)
{
- var assembly = Assembly.GetExecutingAssembly();
-
- if (!buttonTypes?.Any() ?? false)
+ lock (buttonLock)
{
- buttonTypes.AddRange(assembly
- .GetTypes()
- .Where(mytype => mytype.GetInterfaces().Contains(typeof(IButtons))));
- }
+ var assembly = Assembly.GetExecutingAssembly();
+
+ if (!buttonTypes?.Any() ?? false)
+ {
+ buttonTypes.AddRange(assembly
+ .GetTypes()
+ .Where(mytype => mytype.GetInterfaces().Contains(typeof(IButtons))));
+ }
- var buttons = buttonTypes
- ?.First(mytype => mytype.Name.Equals(button.ToString(), StringComparison.CurrentCultureIgnoreCase));
+ var buttons = buttonTypes
+ ?.First(mytype => mytype.Name.Equals(button.ToString(), StringComparison.CurrentCultureIgnoreCase));
- return buttons?.FullName != null
- ? assembly.CreateInstance(buttons.FullName) as IButtons
- : throw new ArgumentOutOfRangeException(nameof(button));
+ return buttons?.FullName != null
+ ? assembly.CreateInstance(buttons.FullName) as IButtons
+ : throw new ArgumentOutOfRangeException(nameof(button));
+ }
}
- }
- ///
- /// Gets or sets the icon brush.
- ///
- /// The icon brush.
- public Brush IconBrush
- {
- get => iconBrush;
- set
+ ///
+ /// Gets or sets the icon brush.
+ ///
+ /// The icon brush.
+ public Brush IconBrush
{
- iconBrush = value;
- NotifyOfPropertyChanged();
+ get => iconBrush;
+ set
+ {
+ iconBrush = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Gets or sets the kind of the icon.
- ///
- /// The kind of the icon.
- public PackIconKind IconKind
- {
- get => iconKind;
- set
+ ///
+ /// Gets or sets the kind of the icon.
+ ///
+ /// The kind of the icon.
+ public PackIconKind IconKind
{
- iconKind = value;
- NotifyOfPropertyChanged();
+ get => iconKind;
+ set
+ {
+ iconKind = value;
+ NotifyOfPropertyChanged();
+ }
}
- }
- ///
- /// Notifies the of property changed.
- ///
- /// Name of the property.
- public void NotifyOfPropertyChanged([CallerMemberName] string propertyName = "")
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
+ ///
+ /// Notifies the of property changed.
+ ///
+ /// Name of the property.
+ public void NotifyOfPropertyChanged([CallerMemberName] string propertyName = "")
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
- ///
- /// Shows the dialog with given configuration.
- ///
- /// The dialog hos identifier.
- /// The opened action.
- /// The closing action.
- /// containing and .
- public async Task ShowDialog(object dialogHosId = null,
- DialogOpenedEventHandler openedAction = null,
- DialogClosingEventHandler closingAction = null)
- {
- return await DialogHost.Show(this, dialogHosId, openedAction, closingAction) as DialogResult? ??
- DialogResult.None;
- }
+ ///
+ /// Shows the dialog with given configuration.
+ ///
+ /// The dialog hos identifier.
+ /// The opened action.
+ /// The closing action.
+ /// containing and .
+ public async Task ShowDialog(object dialogHosId = null,
+ DialogOpenedEventHandler openedAction = null,
+ DialogClosingEventHandler closingAction = null)
+ {
+ return await DialogHost.Show(this, dialogHosId, openedAction, closingAction) as DialogResult? ??
+ DialogResult.None;
+ }
- ///
- /// Shows the dialog with given configuration.
- ///
- /// The dialog hos identifier.
- /// The opened action.
- /// The closing action.
- /// containing and .
- public async Task