feature: add a context menu to copy entire content of SelectableTextBlock (#394)

This commit is contained in:
leo 2024-08-25 15:11:31 +08:00
parent 5dc4ed6f54
commit 7a2722e928
No known key found for this signature in database
6 changed files with 81 additions and 31 deletions

View file

@ -1,5 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="using:SourceGit"
xmlns:vm="using:SourceGit.ViewModels"
xmlns:c="using:SourceGit.Converters"
xmlns:ae="using:AvaloniaEdit"
@ -304,6 +305,14 @@
<Path Width="11" Height="11" Data="{StaticResource Icons.Copy}" VerticalAlignment="Center"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource Text.CopyAllText}"
Command="{x:Static s:App.CopyTextCommand}"
CommandParameter="{Binding $parent[SelectableTextBlock]}">
<MenuItem.Icon>
<Path Width="11" Height="11" Data="{StaticResource Icons.Copy}" VerticalAlignment="Center"/>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Setter.Value>
</Setter>