feat: unify option name.

This commit is contained in:
rabbitism
2024-08-01 12:06:41 +08:00
parent 8941ddfce4
commit 51a1e43608
4 changed files with 5 additions and 2 deletions

View File

@@ -43,6 +43,8 @@ public class OverlayDialogOptions
/// <summary>
/// Only works for CustomDialogControl
/// </summary>
public bool IsCloseButtonVisible { get; set; } = true;
[Obsolete()]
public bool ShowCloseButton { get; set; } = true;
public bool CanLightDismiss { get; set; }
public bool CanDragMove { get; set; } = true;

View File

@@ -195,7 +195,7 @@ public static class OverlayDialog
control.HorizontalAnchor == HorizontalPosition.Center ? null : options.HorizontalOffset;
control.VerticalOffset =
options.VerticalAnchor == VerticalPosition.Center ? null : options.VerticalOffset;
control.IsCloseButtonVisible = options.ShowCloseButton;
control.IsCloseButtonVisible = options.IsCloseButtonVisible;
control.CanLightDismiss = options.CanLightDismiss;
DialogControlBase.SetCanDragMove(control, options.CanDragMove);
}

View File

@@ -196,7 +196,7 @@ public static class Drawer
{
options ??= DrawerOptions.Default;
drawer.Position = options.Position;
drawer.IsCloseButtonVisible = options.ShowCloseButton;
drawer.IsCloseButtonVisible = options.IsCloseButtonVisible;
drawer.CanLightDismiss = options.CanLightDismiss;
if (options.Position == Position.Left || options.Position == Position.Right)
{

View File

@@ -14,6 +14,7 @@ public class DrawerOptions
public double? MaxHeight { get; set; } = null;
public DialogButton Buttons { get; set; } = DialogButton.OKCancel;
public string? Title { get; set; }
[Obsolete("Use IsCloseButtonVisible")]
public bool ShowCloseButton { get; set; } = true;
/// <summary>
/// The hash code of the top level dialog host. This is used to identify the dialog host if there are multiple dialog hosts with the same id. If this is not provided, the dialog will be added to the first dialog host with the same id.