From 77f1e1d7a1b7e23877d63db8dab403451e45c949 Mon Sep 17 00:00:00 2001 From: kikipoulet Date: Sun, 26 May 2024 13:05:48 +0200 Subject: [PATCH] messagebox --- .../Features/ControlsLibrary/MiscView.axaml | 7 +++ .../Features/ControlsLibrary/MiscViewModel.cs | 12 ++++- .../ControlsLibrary/Toasts/ToastsViewModel.cs | 2 +- SukiUI/ColorTheme/Dark.axaml | 2 +- SukiUI/ColorTheme/Light.axaml | 2 +- SukiUI/Controls/MessageBox.axaml | 30 ++++++------ SukiUI/Controls/MessageBox.axaml.cs | 47 +++++++++++++++++++ SukiUI/Controls/SukiHost.axaml.cs | 43 +++++++++++++++++ SukiUI/Controls/SukiToast.axaml | 15 +++--- SukiUI/Models/MessageBoxModel.cs | 17 +++++++ 10 files changed, 151 insertions(+), 26 deletions(-) create mode 100644 SukiUI/Models/MessageBoxModel.cs diff --git a/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml b/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml index ee505a14d..15c0d4a1b 100644 --- a/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml +++ b/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml @@ -125,6 +125,13 @@ Command="{Binding OpenBoxCommand}" Content="Open MessageBox" /> + @@ -68,13 +68,12 @@ - + Margin="22,0,0,0" Background="{DynamicResource SukiCardBackground}" Width="35" Height="35" CornerRadius="35" VerticalAlignment="Center" HorizontalAlignment="Left"> + - - - + diff --git a/SukiUI/Models/MessageBoxModel.cs b/SukiUI/Models/MessageBoxModel.cs new file mode 100644 index 000000000..e338ae4a2 --- /dev/null +++ b/SukiUI/Models/MessageBoxModel.cs @@ -0,0 +1,17 @@ +using System; +using SukiUI.Enums; + +namespace SukiUI.Models +{ + public readonly record struct MessageBoxModel(string Title, object Content, ToastType Type = ToastType.Info, string? ActionButtonContent = null,Action? ActionButton= null) + { + public string Title { get; } = Title; + public object Content { get; } = Content; + public ToastType Type { get; } = Type; + + + + public string? ActionButtonContent { get; } = ActionButtonContent; + public Action? OnActionButtonClicked { get; } = ActionButton; + } +} \ No newline at end of file