mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-19 16:06:35 +08:00
24 lines
564 B
C#
24 lines
564 B
C#
using System.Threading.Tasks;
|
|
using Avalonia.Controls;
|
|
using Semi.Avalonia.Demo.ViewModels;
|
|
|
|
namespace Semi.Avalonia.Demo.Pages;
|
|
|
|
public partial class HighContrastDemo : UserControl
|
|
{
|
|
public HighContrastDemo()
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = new HighContrastDemoViewModel();
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
} |