Clipboard
A ghost icon button that copies its text and shows a check mark afterwards.
ExampleInteractive
<StackPanel Orientation="Horizontal" Spacing="4" HorizontalAlignment="Left">
<TextBlock Text="dotnet add package AvaloniaUIKit" VerticalAlignment="Center" />
<uikit:Clipboard Text="dotnet add package AvaloniaUIKit" />
</StackPanel>Usage
uikit:Clipboard is a Button (so Click and Command work) drawn as a ghost icon-only button with the copy icon. Set Text to what it copies; a click writes it to the clipboard, raises Copied, and shows the check icon for two seconds (the :copied pseudo-class and IsCopied), during which another click does nothing. Sizes are the Button's: xsmall, small, large (medium is the default).
Examples
The four sizes.


<WrapPanel ItemSpacing="8" LineSpacing="8">
<uikit:Clipboard Classes="xsmall" Text="Copied text" />
<uikit:Clipboard Classes="small" Text="Copied text" />
<uikit:Clipboard Text="Copied text" />
<uikit:Clipboard Classes="large" Text="Copied text" />
</WrapPanel>Not covered
- Computing the value at click time: set
Textbefore the click instead.