<ResourceDictionary xmlns="https://github.com/avaloniaui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Design.PreviewWith>
        <SelectableTextBlock Text="Preview" />
    </Design.PreviewWith>

    <MenuFlyout x:Key="SelectableTextBlockContextFlyout" Placement="Bottom">
        <MenuItem x:Name="SelectableTextBlockContextFlyoutCopyItem" Header="Copy" Command="{Binding $parent[SelectableTextBlock].Copy}"
                  IsEnabled="{Binding $parent[SelectableTextBlock].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}" />
    </MenuFlyout>

    <ControlTheme x:Key="{x:Type SelectableTextBlock}" TargetType="SelectableTextBlock">
        <Setter Property="SelectionBrush" Value="{DynamicResource ThemeControlHighlightBrush}" />

        <Style Selector="^[IsEnabled=True]">
            <Setter Property="Cursor" Value="IBeam" />
            <Setter Property="ContextFlyout" Value="{StaticResource SelectableTextBlockContextFlyout}" />
        </Style>
    </ControlTheme>
</ResourceDictionary>