Skip to content

Commit 92e87fb

Browse files
authored
Code Quality: Fixed crash in BladeItem control (#16842)
1 parent 1c25e81 commit 92e87fb

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Files.App.Controls/BladeView/BladeItem.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public BladeItem()
3737
protected override void OnApplyTemplate()
3838
{
3939
_loaded = true;
40-
base.OnApplyTemplate();
4140

4241
_closeButton = GetTemplateChild("CloseButton") as Button;
4342
_enlargeButton = GetTemplateChild("EnlargeButton") as Button;
@@ -66,10 +65,9 @@ private void OnExpanding(Expander sender, ExpanderExpandingEventArgs args)
6665
{
6766
Width = _normalModeWidth;
6867
VisualStateManager.GoToState(this, "Expanded", true);
69-
var name = "WCT_BladeView_ExpandButton_Collapsed".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources");
7068
if (_enlargeButton != null)
7169
{
72-
AutomationProperties.SetName(_enlargeButton, name);
70+
AutomationProperties.SetName(_enlargeButton, "Expand Blade Item");
7371
}
7472
}
7573
}
@@ -80,11 +78,9 @@ private void OnCollapsed(Expander sender, ExpanderCollapsedEventArgs args)
8078
if (_loaded)
8179
{
8280
Width = double.NaN;
83-
VisualStateManager.GoToState(this, "Collapsed", true);
84-
var name = "WCT_BladeView_ExpandButton_Expanded".GetLocalized("CommunityToolkit.WinUI.UI.Controls.Layout/Resources");
8581
if (_enlargeButton != null)
8682
{
87-
AutomationProperties.SetName(_enlargeButton, name);
83+
AutomationProperties.SetName(_enlargeButton, "Collapse Blade Item");
8884
}
8985
}
9086
}

src/Files.App.Controls/GridSplitter/GridSplitter.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ public GridSplitter()
161161
{
162162
DefaultStyleKey = typeof(GridSplitter);
163163
Loaded += GridSplitter_Loaded;
164-
string automationName = CommunityToolkit.WinUI.StringExtensions.GetLocalized("WCT_GridSplitter_AutomationName", "CommunityToolkit.WinUI.UI.Controls.Layout/Resources");
165-
AutomationProperties.SetName(this, automationName);
164+
AutomationProperties.SetName(this, "Grid Splitter");
166165
}
167166

168167
/// <inheritdoc />

0 commit comments

Comments
 (0)