-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Material.Styles/Resources/Themes/SelectableTextBlock.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:ClassModifier="internal"> | ||
<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 PrimaryHueMidBrush}" /> | ||
|
||
<Style Selector="^[IsEnabled=True]"> | ||
<Setter Property="Cursor" Value="IBeam" /> | ||
<Setter Property="ContextFlyout" Value="{StaticResource SelectableTextBlockContextFlyout}" /> | ||
</Style> | ||
</ControlTheme> | ||
</ResourceDictionary> |