From 5d0116ca8e48e936df55e64d928a746c565280c0 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 21 Jan 2025 20:32:37 +0800
Subject: [PATCH] feat: add DynamicResource CopyButton.
---
.../Pages/VariablesDemo.axaml | 19 +++++++---
.../Themes/FunctionalColorGroupControl.axaml | 38 ++++++++++++++-----
.../Themes/ShadowGroupControl.axaml | 38 ++++++++++++++-----
.../ViewModels/PaletteDemoViewModel.cs | 14 ++++++-
.../ViewModels/VariablesDemoViewModel.cs | 7 +++-
5 files changed, 88 insertions(+), 28 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml
index 9db4525..20032b3 100644
--- a/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml
+++ b/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml
@@ -55,11 +55,20 @@
-
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml b/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml
index e48d547..f59de67 100644
--- a/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml
+++ b/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml
@@ -70,11 +70,20 @@
-
+
+
+
+
@@ -134,11 +143,20 @@
-
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml b/demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml
index 286b13c..a50fb67 100644
--- a/demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml
+++ b/demo/Semi.Avalonia.Demo/Themes/ShadowGroupControl.axaml
@@ -49,11 +49,20 @@
-
+
+
+
+
@@ -92,11 +101,20 @@
-
+
+
+
+
diff --git a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
index f1e0065..deddf1a 100644
--- a/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
+++ b/demo/Semi.Avalonia.Demo/ViewModels/PaletteDemoViewModel.cs
@@ -135,11 +135,16 @@ public partial class ColorItemViewModel : ObservableObject
[ObservableProperty] private string? _colorResourceKey;
[ObservableProperty] private string? _hex;
- public string CopyText =>
+ public string CopyText1 =>
$"""
""";
+ public string CopyText2 =>
+ $"""
+
+ """;
+
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light,
int index)
{
@@ -196,11 +201,16 @@ public partial class ShadowItemViewModel : ObservableObject
[ObservableProperty] private string? _resourceKey;
[ObservableProperty] private string? _boxShadowValue;
- public string CopyText =>
+ public string CopyText1 =>
$"""
""";
+ public string CopyText2 =>
+ $"""
+
+ """;
+
public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey)
{
ShadowDisplayName = shadowDisplayName;
diff --git a/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs
index 753d23a..43a538e 100644
--- a/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs
+++ b/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs
@@ -76,11 +76,16 @@ public partial class VariableItemViewModel : ObservableObject
[ObservableProperty] private string? _description;
[ObservableProperty] private string? _value;
- public string CopyText =>
+ public string CopyText1 =>
$"""
""";
+ public string CopyText2 =>
+ $"""
+
+ """;
+
public VariableItemViewModel(string description, object value, string resourceKey)
{
ResourceKey = resourceKey;