diff --git a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs index 44c6fe8..5d6be69 100644 --- a/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/PaletteDemo.axaml.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using Avalonia.Controls; using Avalonia.Controls.Primitives; using Avalonia.Threading; @@ -19,4 +20,14 @@ public partial class PaletteDemo : UserControl PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel; await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); }); } + + public async Task Copy(object? o) + { + if (o is null) return; + var toplevel = TopLevel.GetTopLevel(this); + if (toplevel?.Clipboard is { } c) + { + await c.SetTextAsync(o.ToString()); + } + } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml b/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml index 5971866..e48d547 100644 --- a/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml +++ b/demo/Semi.Avalonia.Demo/Themes/FunctionalColorGroupControl.axaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls" xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels" + xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" x:CompileBindings="True" x:DataType="viewModels:FunctionalColorGroupViewModel"> @@ -30,27 +31,21 @@ - + - @@ -60,13 +55,29 @@ + + + + +