mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-02 07:06:36 +08:00
feat: add CopyText to PaletteDemo.
This commit is contained in:
@@ -7,8 +7,8 @@ using Avalonia.Media;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Semi.Avalonia.Demo.Constant;
|
||||
using Semi.Avalonia.Tokens.Palette;
|
||||
using Semi.Avalonia.Demo.Converters;
|
||||
using Semi.Avalonia.Tokens.Palette;
|
||||
|
||||
namespace Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
@@ -135,6 +135,11 @@ public partial class ColorItemViewModel : ObservableObject
|
||||
[ObservableProperty] private string? _colorResourceKey;
|
||||
[ObservableProperty] private string? _hex;
|
||||
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, string resourceKey, bool light,
|
||||
int index)
|
||||
{
|
||||
@@ -191,6 +196,11 @@ public partial class ShadowItemViewModel : ObservableObject
|
||||
[ObservableProperty] private string? _resourceKey;
|
||||
[ObservableProperty] private string? _boxShadowValue;
|
||||
|
||||
public string CopyText =>
|
||||
$"""
|
||||
<StaticResource x:Key="" ResourceKey="{ResourceKey}" />
|
||||
""";
|
||||
|
||||
public ShadowItemViewModel(string shadowDisplayName, BoxShadows boxShadows, string resourceKey)
|
||||
{
|
||||
ShadowDisplayName = shadowDisplayName;
|
||||
|
||||
Reference in New Issue
Block a user