feat: re-organize file, add IsCloseButtonVisible option.
This commit is contained in:
11
src/Ursa/Controls/Dialog/Options/DialogButton.cs
Normal file
11
src/Ursa/Controls/Dialog/Options/DialogButton.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public enum DialogButton
|
||||
{
|
||||
None,
|
||||
OK,
|
||||
OKCancel,
|
||||
YesNo,
|
||||
YesNoCancel,
|
||||
}
|
||||
|
||||
11
src/Ursa/Controls/Dialog/Options/DialogMode.cs
Normal file
11
src/Ursa/Controls/Dialog/Options/DialogMode.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public enum DialogMode
|
||||
{
|
||||
Info,
|
||||
Warning,
|
||||
Error,
|
||||
Question,
|
||||
None,
|
||||
Success,
|
||||
}
|
||||
29
src/Ursa/Controls/Dialog/Options/DialogOptions.cs
Normal file
29
src/Ursa/Controls/Dialog/Options/DialogOptions.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public class DialogOptions
|
||||
{
|
||||
public static DialogOptions Default { get; } = new DialogOptions();
|
||||
/// <summary>
|
||||
/// The Startup Location of DialogWindow. Default is <see cref="WindowStartupLocation.CenterOwner"/>
|
||||
/// </summary>
|
||||
public WindowStartupLocation StartupLocation { get; set; } = WindowStartupLocation.CenterOwner;
|
||||
/// <summary>
|
||||
/// The Position of DialogWindow startup location if <see cref="StartupLocation"/> is <see cref="WindowStartupLocation.Manual"/>
|
||||
/// </summary>
|
||||
public PixelPoint? Position { get; set; }
|
||||
/// <summary>
|
||||
/// Title of DialogWindow, Default is null
|
||||
/// </summary>
|
||||
public string? Title { get; set; }
|
||||
/// <summary>
|
||||
/// DialogWindow's Mode, Default is <see cref="DialogMode.None"/>
|
||||
/// </summary>
|
||||
public DialogMode Mode { get; set; } = DialogMode.None;
|
||||
|
||||
public DialogButton Button { get; set; } = DialogButton.OKCancel;
|
||||
|
||||
public bool IsCloseButtonVisible { get; set; } = true;
|
||||
}
|
||||
10
src/Ursa/Controls/Dialog/Options/DialogResult.cs
Normal file
10
src/Ursa/Controls/Dialog/Options/DialogResult.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public enum DialogResult
|
||||
{
|
||||
Cancel,
|
||||
No,
|
||||
None,
|
||||
OK,
|
||||
Yes,
|
||||
}
|
||||
28
src/Ursa/Controls/Dialog/Options/OverlayDialogOptions.cs
Normal file
28
src/Ursa/Controls/Dialog/Options/OverlayDialogOptions.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Ursa.Controls;
|
||||
|
||||
public enum HorizontalPosition
|
||||
{
|
||||
Left,
|
||||
Center,
|
||||
Right
|
||||
}
|
||||
|
||||
public enum VerticalPosition
|
||||
{
|
||||
Top,
|
||||
Center,
|
||||
Bottom
|
||||
}
|
||||
|
||||
public class OverlayDialogOptions
|
||||
{
|
||||
public bool CanClickOnMaskToClose { get; set; } = false;
|
||||
public HorizontalPosition HorizontalAnchor { get; set; } = HorizontalPosition.Center;
|
||||
public VerticalPosition VerticalAnchor { get; set; } = VerticalPosition.Center;
|
||||
public double? HorizontalOffset { get; set; } = null;
|
||||
public double? VerticalOffset { get; set; } = null;
|
||||
public DialogMode Mode { get; set; } = DialogMode.None;
|
||||
public DialogButton Buttons { get; set; } = DialogButton.OKCancel;
|
||||
public string? Title { get; set; } = null;
|
||||
public bool IsCloseButtonVisible { get; set; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user