From 43b4664536884648a9310fd3d7371822c98508dc Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Tue, 14 Nov 2023 17:27:40 +0100 Subject: [PATCH] feat: modernize TemplateControl template --- .../NewTemplatedControl.axaml | 36 ++++++++++++++---- .../NewTemplatedControl.axaml.cs | 2 + .../NewTemplatedControl.axaml | 37 +++++++++++++++---- .../NewTemplatedControl.axaml.fs | 2 + 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/templates/csharp/templatedcontrol/NewTemplatedControl.axaml b/templates/csharp/templatedcontrol/NewTemplatedControl.axaml index 9634f151..fe6c4b69 100644 --- a/templates/csharp/templatedcontrol/NewTemplatedControl.axaml +++ b/templates/csharp/templatedcontrol/NewTemplatedControl.axaml @@ -1,16 +1,38 @@ - - + + + + + + + + + + + + - - + + diff --git a/templates/csharp/templatedcontrol/NewTemplatedControl.axaml.cs b/templates/csharp/templatedcontrol/NewTemplatedControl.axaml.cs index cba31245..bbc9fe4a 100644 --- a/templates/csharp/templatedcontrol/NewTemplatedControl.axaml.cs +++ b/templates/csharp/templatedcontrol/NewTemplatedControl.axaml.cs @@ -4,4 +4,6 @@ namespace AvaloniaAppTemplate.Namespace; public class NewTemplatedControl : TemplatedControl { + protected override Type StyleKeyOverride => + typeof(Avalonia.Labs.Controls.ContentDialog); } \ No newline at end of file diff --git a/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml b/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml index 9634f151..89c35615 100644 --- a/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml +++ b/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml @@ -1,16 +1,37 @@ - - - + + + + + + + + + + + + - - + + diff --git a/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml.fs b/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml.fs index 0fb74e09..1f67d247 100644 --- a/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml.fs +++ b/templates/fsharp/templatedcontrol/NewTemplatedControl.axaml.fs @@ -4,3 +4,5 @@ open Avalonia.Controls.Primitives type NewTemplatedControl () = inherit TemplatedControl () + override StyleKeyOverride + with get() = typedefof