From bdfa2f66a7db07f2ddf8a76a5f345fd91ea68aa4 Mon Sep 17 00:00:00 2001 From: RSOrokin Date: Mon, 3 Nov 2025 11:40:53 +0300 Subject: [PATCH] fix some issues --- Exmaple2.0/Exmaple2.0.csproj | 2 +- .../Controls/MsBoxCustomView.axaml.cs | 17 ++ .../Controls/MsBoxStandardView.axaml.cs | 17 ++ MsBox.Avalonia/MsBox.Avalonia.csproj | 2 +- README.md | 151 ++++++++++++------ 5 files changed, 138 insertions(+), 51 deletions(-) diff --git a/Exmaple2.0/Exmaple2.0.csproj b/Exmaple2.0/Exmaple2.0.csproj index 70965ff..c83ce64 100644 --- a/Exmaple2.0/Exmaple2.0.csproj +++ b/Exmaple2.0/Exmaple2.0.csproj @@ -1,7 +1,7 @@  WinExe - net8.0 + net9.0 enable enable true diff --git a/MsBox.Avalonia/Controls/MsBoxCustomView.axaml.cs b/MsBox.Avalonia/Controls/MsBoxCustomView.axaml.cs index 1d8817e..7438c88 100644 --- a/MsBox.Avalonia/Controls/MsBoxCustomView.axaml.cs +++ b/MsBox.Avalonia/Controls/MsBoxCustomView.axaml.cs @@ -1,4 +1,6 @@ using Avalonia.Controls; +using Avalonia.LogicalTree; +using Avalonia.Threading; using MsBox.Avalonia.Base; using MsBox.Avalonia.ViewModels; @@ -13,6 +15,21 @@ public partial class MsBoxCustomView : UserControl, IFullApi, ISetCloseA public MsBoxCustomView() { InitializeComponent(); + + this.AttachedToVisualTree += (s, e) => + { + Dispatcher.UIThread.Post(() => + { + var defaultButton = this.GetLogicalDescendants() + .OfType