fix: resolve root module null reference and itemsview scroll bug

This commit is contained in:
2026-03-29 12:30:07 +09:00
parent 60ef684d80
commit a33a150d06
3 changed files with 13 additions and 3 deletions

View File

@@ -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();
}
}
}

View File

@@ -147,7 +147,8 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollMode="Disabled"
SelectionChanged="PART_FilesView_SelectionChanged"
SelectionMode="Single">
SelectionMode="Single"
SizeChanged="PART_FilesView_SizeChanged">
<ItemsView.ItemTemplate>
<DataTemplate x:DataType="model:ExplorerItem">
<ItemContainer>

View File

@@ -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)