Skip to content

Commit af7bcc1

Browse files
committed
Add DialogHost properties and fix crash
1 parent 077751a commit af7bcc1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/MvvmDialogs.Avalonia.DialogHost/DialogHostApi.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ internal class DialogHostApi : IDialogHostApi
2525
host.CloseOnClickAway = settings.CloseOnClickAway;
2626
host.CloseOnClickAwayParameter = settings.CloseOnClickAwayParameter;
2727
host.PopupPositioner = settings.PopupPositioner;
28+
host.OverlayBackground = settings.OverlayBackground ?? host.OverlayBackground;
29+
host.DialogMargin = settings.DialogMargin ?? host.DialogMargin;
30+
host.DisableOpeningAnimation = settings.DisableOpeningAnimation;
2831
}
2932

3033
var closingHandler = settings.ClosingHandler ?? ((_, _) => { });

src/MvvmDialogs.Avalonia.DialogHost/DialogHostSettings.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.ComponentModel;
2+
using Avalonia.Media;
23
using DialogHostAvalonia;
34
using DialogHostAvalonia.Positioners;
45

@@ -29,4 +30,16 @@ public class DialogHostSettings : DialogSettingsBase
2930
/// A class allowing to customize the positioning of the dialog.
3031
/// </summary>
3132
public IDialogPopupPositioner? PopupPositioner { get; set; }
33+
/// <summary>
34+
/// The background of the overlay.
35+
/// </summary>
36+
public IBrush? OverlayBackground { get; set; }
37+
/// <summary>
38+
/// The margin of the dialog view.
39+
/// </summary>
40+
public Thickness? DialogMargin { get; set; }
41+
/// <summary>
42+
/// Whether to disable the popup animation.
43+
/// </summary>
44+
public bool DisableOpeningAnimation { get; set; } = true;
3245
}

0 commit comments

Comments
 (0)