diff --git a/src/Editor/Ghost.Editor/View/Controls/Docking/DockContainer.cs b/src/Editor/Ghost.Editor/View/Controls/Docking/DockContainer.cs index 20cb5cb..dacf2e5 100644 --- a/src/Editor/Ghost.Editor/View/Controls/Docking/DockContainer.cs +++ b/src/Editor/Ghost.Editor/View/Controls/Docking/DockContainer.cs @@ -152,8 +152,9 @@ public abstract class DockContainer : DockModule } else if (Root != null && Root.RootModule == this) { - Root.RootModule = null; - Root.NotifyLayoutEmpty(); + var root = Root; + root.RootModule = null; + root.NotifyLayoutEmpty(); } } } diff --git a/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml b/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml index 959502a..80fa197 100644 --- a/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml +++ b/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml @@ -147,7 +147,8 @@ ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollMode="Disabled" SelectionChanged="PART_FilesView_SelectionChanged" - SelectionMode="Single"> + SelectionMode="Single" + SizeChanged="PART_FilesView_SizeChanged"> diff --git a/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml.cs b/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml.cs index 4563234..11d6a36 100644 --- a/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml.cs +++ b/src/Editor/Ghost.Editor/View/Controls/ProjectBrowser.xaml.cs @@ -107,6 +107,14 @@ internal sealed partial class ProjectBrowser : UserControl _isUpdatingSelection = false; } + private void PART_FilesView_SizeChanged(object sender, SizeChangedEventArgs e) + { + if (e.NewSize.Width > 0 && e.NewSize.Height > 0) + { + PART_FilesView.UpdateLayout(); + } + } + private async void PART_FilesView_DoubleTapped(object sender, Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs e) { if (PART_FilesView.SelectedItem is ExplorerItem selectedItem)