From 9e4fb6a6f2f8e7fe12131d85f512a3952b153ff6 Mon Sep 17 00:00:00 2001 From: Steven He Date: Sat, 22 Feb 2025 03:59:32 +0900 Subject: [PATCH] Fix ColumnView crashing --- src/Files.App.Controls/BladeView/BladeItem.cs | 8 ++------ src/Files.App.Controls/GridSplitter/GridSplitter.cs | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Files.App.Controls/BladeView/BladeItem.cs b/src/Files.App.Controls/BladeView/BladeItem.cs index 081755adede3..4e1a83d55d02 100644 --- a/src/Files.App.Controls/BladeView/BladeItem.cs +++ b/src/Files.App.Controls/BladeView/BladeItem.cs @@ -37,7 +37,6 @@ public BladeItem() protected override void OnApplyTemplate() { _loaded = true; - base.OnApplyTemplate(); _closeButton = GetTemplateChild("CloseButton") as Button; _enlargeButton = GetTemplateChild("EnlargeButton") as Button; @@ -66,10 +65,9 @@ private void OnExpanding(Expander sender, ExpanderExpandingEventArgs args) { Width = _normalModeWidth; VisualStateManager.GoToState(this, "Expanded", true); - var name = "WCT_BladeView_ExpandButton_Collapsed".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); if (_enlargeButton != null) { - AutomationProperties.SetName(_enlargeButton, name); + AutomationProperties.SetName(_enlargeButton, "Expand Blade Item"); } } } @@ -80,11 +78,9 @@ private void OnCollapsed(Expander sender, ExpanderCollapsedEventArgs args) if (_loaded) { Width = double.NaN; - VisualStateManager.GoToState(this, "Collapsed", true); - var name = "WCT_BladeView_ExpandButton_Expanded".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); if (_enlargeButton != null) { - AutomationProperties.SetName(_enlargeButton, name); + AutomationProperties.SetName(_enlargeButton, "Collapse Blade Item"); } } } diff --git a/src/Files.App.Controls/GridSplitter/GridSplitter.cs b/src/Files.App.Controls/GridSplitter/GridSplitter.cs index 57fe23d20194..4f46a2486cef 100644 --- a/src/Files.App.Controls/GridSplitter/GridSplitter.cs +++ b/src/Files.App.Controls/GridSplitter/GridSplitter.cs @@ -161,8 +161,7 @@ public GridSplitter() { DefaultStyleKey = typeof(GridSplitter); Loaded += GridSplitter_Loaded; - string automationName = CommunityToolkit.WinUI.StringExtensions.GetLocalized("WCT_GridSplitter_AutomationName", "CommunityToolkit.WinUI.UI.Controls.Layout/Resources"); - AutomationProperties.SetName(this, automationName); + AutomationProperties.SetName(this, "Grid Splitter"); } ///