From fe0139a648450c2f9710ec00b069660b2ef493b8 Mon Sep 17 00:00:00 2001 From: Piero Castillo Date: Tue, 6 Feb 2024 22:14:05 -0500 Subject: [PATCH] ... --- .../Controls/CodeExample.axaml | 4 +-- .../Controls/CodeExample.axaml.cs | 36 +++++++++++++++---- samples/Aura.UI.Gallery/Pages/BadgePage.axaml | 4 +-- samples/Aura.UI.Gallery/ViewLocator.cs | 2 +- samples/Aura.UI.Gallery/Views/MainView.axaml | 2 +- .../Controls/NavigationViewItemStyles.xaml | 4 +-- 6 files changed, 37 insertions(+), 15 deletions(-) diff --git a/samples/Aura.UI.Gallery/Controls/CodeExample.axaml b/samples/Aura.UI.Gallery/Controls/CodeExample.axaml index a264f23..bedc362 100644 --- a/samples/Aura.UI.Gallery/Controls/CodeExample.axaml +++ b/samples/Aura.UI.Gallery/Controls/CodeExample.axaml @@ -42,13 +42,13 @@ using System; BorderThickness="1" Padding="15" Content="{TemplateBinding Control}"/> - - (e, "editor_xaml"); - c_edit = this.GetControl(e, "editor_csharp"); + editor_xaml.Text = XAMLText; + editor_csharp.Text = CSharpText; - c_edit.TextArea.IndentationStrategy = new CSharpIndentationStrategy(); + editor_xaml.ShowLineNumbers = true; + editor_csharp.ShowLineNumbers = true; - xaml_edit.Text = XAMLText; - c_edit.Text = CSharpText; + RegistryOptions _registryOptions; + if (App.Current.RequestedThemeVariant == ThemeVariant.Light) + { + _registryOptions = new RegistryOptions(ThemeName.Light); + } + else + { + _registryOptions = new RegistryOptions(ThemeName.Dark); + } + + + //Initial setup of TextMate. + var _textMateCSharp = editor_csharp.InstallTextMate(_registryOptions); + _textMateCSharp.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(".cs").Id)); + + var _textMateXaml = editor_xaml.InstallTextMate(_registryOptions); + _textMateXaml.SetGrammar(_registryOptions.GetScopeByLanguageId(_registryOptions.GetLanguageByExtension(".axaml").Id)); } [Content] diff --git a/samples/Aura.UI.Gallery/Pages/BadgePage.axaml b/samples/Aura.UI.Gallery/Pages/BadgePage.axaml index 2179d5e..4eaaf32 100644 --- a/samples/Aura.UI.Gallery/Pages/BadgePage.axaml +++ b/samples/Aura.UI.Gallery/Pages/BadgePage.axaml @@ -50,8 +50,8 @@