From 4e902fb6a2db30fb8d50b509d49851e277fbbd84 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Sat, 14 Dec 2024 08:12:04 -0800 Subject: [PATCH] remove explicit datatemplate, we are setting this globally in application --- src/Consolonia.Core/Controls/ConsoloniaAccessText.cs | 5 +++++ .../Infrastructure/ConsoloniaApplication.cs | 4 ++-- src/Consolonia.Themes/Templates/Controls/Menu.axaml | 7 ------- src/Consolonia.Themes/Templates/Controls/MenuItem.axaml | 5 ----- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Consolonia.Core/Controls/ConsoloniaAccessText.cs b/src/Consolonia.Core/Controls/ConsoloniaAccessText.cs index d0d8e2c5..c090a081 100644 --- a/src/Consolonia.Core/Controls/ConsoloniaAccessText.cs +++ b/src/Consolonia.Core/Controls/ConsoloniaAccessText.cs @@ -12,6 +12,11 @@ public sealed class ConsoloniaAccessText : AccessText { private Run _accessRun; + static ConsoloniaAccessText() + { + AffectsRender(ShowAccessKeyProperty); + } + public ConsoloniaAccessText() { this.PropertyChanged += OnPropertyChanged; diff --git a/src/Consolonia.Core/Infrastructure/ConsoloniaApplication.cs b/src/Consolonia.Core/Infrastructure/ConsoloniaApplication.cs index a2ab96d0..be20340d 100644 --- a/src/Consolonia.Core/Infrastructure/ConsoloniaApplication.cs +++ b/src/Consolonia.Core/Infrastructure/ConsoloniaApplication.cs @@ -25,9 +25,9 @@ public override void OnFrameworkInitializationCompleted() { // override AccessText to use ConsoloniaAccessText as default contentpresenter for unknown data types (aka string) this.DataTemplates.Add(new FuncDataTemplate( - (data, s) => + (data, _) => { - if (data != null && data is string str) + if (data != null && data is string) { var result = new ConsoloniaAccessText(); result.Bind(TextBlock.TextProperty, diff --git a/src/Consolonia.Themes/Templates/Controls/Menu.axaml b/src/Consolonia.Themes/Templates/Controls/Menu.axaml index 363b9130..2e63ebd5 100644 --- a/src/Consolonia.Themes/Templates/Controls/Menu.axaml +++ b/src/Consolonia.Themes/Templates/Controls/Menu.axaml @@ -22,13 +22,6 @@ - - - - - - - - - - -