diff --git a/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml b/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml
index 23597f8ac..ee505a14d 100644
--- a/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml
+++ b/SukiUI.Demo/Features/ControlsLibrary/MiscView.axaml
@@ -114,6 +114,20 @@
+
+
+
+
+
+
+
+
+
diff --git a/SukiUI.Demo/Features/ControlsLibrary/MiscViewModel.cs b/SukiUI.Demo/Features/ControlsLibrary/MiscViewModel.cs
index 2bff5e7bb..784d3dcb6 100644
--- a/SukiUI.Demo/Features/ControlsLibrary/MiscViewModel.cs
+++ b/SukiUI.Demo/Features/ControlsLibrary/MiscViewModel.cs
@@ -7,6 +7,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Material.Icons;
+using SukiUI.Controls;
namespace SukiUI.Demo.Features.ControlsLibrary;
@@ -23,6 +24,12 @@ private async Task ToggleBusy()
await Task.Delay(3000);
IsBusy = false;
}
+
+ [RelayCommand]
+ private void OpenBox()
+ {
+ SukiHost.ShowDialog(new MessageBox(), false, true);
+ }
[RelayCommand]
private void OpenFile()
diff --git a/SukiUI/Controls/MessageBox.axaml b/SukiUI/Controls/MessageBox.axaml
index 3c2b5d01c..5bdd7afba 100644
--- a/SukiUI/Controls/MessageBox.axaml
+++ b/SukiUI/Controls/MessageBox.axaml
@@ -1,99 +1,70 @@
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/SukiUI/Controls/MessageBox.axaml.cs b/SukiUI/Controls/MessageBox.axaml.cs
index b85973d5f..c5a67e87d 100644
--- a/SukiUI/Controls/MessageBox.axaml.cs
+++ b/SukiUI/Controls/MessageBox.axaml.cs
@@ -1,66 +1,14 @@
+using Avalonia;
using Avalonia.Controls;
-using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
-using Avalonia.Media;
-using SukiUI.Content;
-using SukiUI.Extensions;
-namespace SukiUI.Controls;
-
-public partial class MessageBox : Window
+namespace SukiUI.Controls
{
- private static readonly SolidColorBrush InfoBrush = new(Color.FromRgb(47, 84, 235));
-
- public MessageBox()
- {
- InitializeComponent();
- }
-
- public MessageBox(string title, string message)
- {
- InitializeComponent();
- this.FindRequiredControl("Title").Text = title;
- this.FindRequiredControl("Message").Text = message;
- }
-
- private void InitializeComponent()
- {
- AvaloniaXamlLoader.Load(this);
- CanResize = false;
- }
-
- public static void Info(Window owner, string title, string message, WindowStartupLocation startupLocation = WindowStartupLocation.CenterScreen)
- {
- var mbox = new MessageBox(title, message);
- if (mbox.FindControl("InfoIcon") is not { } icon) return;
- icon.Data = Icons.CircleInformation;
- icon.Foreground = InfoBrush;
- mbox.WindowStartupLocation = startupLocation;
- mbox.ShowDialog(owner);
- }
-
- public static void Success(Window owner, string title, string message, WindowStartupLocation startupLocation = WindowStartupLocation.CenterScreen)
- {
- var mbox = new MessageBox(title, message);
- if (mbox.FindControl("InfoIcon") is not { } icon) return;
- icon.Data = Icons.CircleCheck;
- icon.Foreground = Brushes.DarkGreen;
- mbox.WindowStartupLocation = startupLocation;
- mbox.ShowDialog(owner);
- }
-
- public static void Error(Window owner, string title, string message, WindowStartupLocation startupLocation = WindowStartupLocation.CenterScreen)
- {
- var mbox = new MessageBox(title, message);
- if (mbox.FindControl("InfoIcon") is not { } icon) return;
- icon.Data = Icons.CircleClose;
- icon.Foreground = Brushes.DarkRed;
- mbox.WindowStartupLocation = startupLocation;
- mbox.ShowDialog(owner);
- }
-
- private void Close(object sender, RoutedEventArgs e)
+ public partial class MessageBox : UserControl
{
- Close();
+ public MessageBox()
+ {
+ InitializeComponent();
+ }
}
}
\ No newline at end of file
diff --git a/SukiUI/Controls/SukiToast.axaml b/SukiUI/Controls/SukiToast.axaml
index d27e76ba0..94639c156 100644
--- a/SukiUI/Controls/SukiToast.axaml
+++ b/SukiUI/Controls/SukiToast.axaml
@@ -71,12 +71,12 @@
Margin="20,0,0,0" Background="{DynamicResource SukiCardBackground}" Width="40" Height="40" CornerRadius="40" VerticalAlignment="Center" HorizontalAlignment="Left">
-
-
+
+
+ Foreground="White" />
diff --git a/SukiUI/SukiUI.csproj b/SukiUI/SukiUI.csproj
index 82852ea36..1185fd2fb 100644
--- a/SukiUI/SukiUI.csproj
+++ b/SukiUI/SukiUI.csproj
@@ -91,10 +91,6 @@
WaveProgress.axaml
Code
-
- MessageBox.axaml
- Code
-