Page 1 of 1

ApplicationCommands.Cut not reacting on selection in TextBox

Posted: 05 Jun 2023, 14:54
by Umarsh
Hi,

I have a trouble with ApplicationCommands.Cut and ApplicationCommands.Copy. Buttons with this commands don't become active when i select text in textbox before i call context menu with right click. But all works great in wpf: when click "Select All" or select text by mouse, button "Cut" dynamically makes active.

Xaml:
<StackPanel
            Grid.Row="0"
            Margin="0,0,0,10"
            Orientation="Horizontal">
            <Button
                Command="ApplicationCommands.SelectAll"
                CommandTarget="{Binding ElementName=KeyboardTextBox}"
                Style="{StaticResource EditButtonStyle}">
                <TextBlock Style="{StaticResource EditButtonTextStyle}" Text="Select all" />
            </Button>
            <Button
                Command="ApplicationCommands.Cut"
                CommandTarget="{Binding ElementName=KeyboardTextBox}"
                Style="{StaticResource EditButtonStyle}">
                <TextBlock Style="{StaticResource EditButtonTextStyle}" Text="Cut" />
            </Button>
           ...
        </StackPanel>
        ...
        <TextBox
                            x:Name="KeyboardTextBox"
                            MaxWidth="{Binding ElementName=itemsControl, Path=ActualWidth}"
                            MaxHeight="90"
                            Margin="8,8,8,0"
                            kbdAtt:FocusExtension.IsFocused="{Binding IsVisible}"
                            Focusable="True"
                            FontFamily="Jura"
                            FontSize="29"
                            FontWeight="SemiBold"
                            IsReadOnly="False"
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            SelectionBrush="{StaticResource Brush.Alarm}"
                            TextWrapping="Wrap" />

Re: ApplicationCommands.Cut not reacting on selection in TextBox

Posted: 06 Jun 2023, 14:09
by sfernandez
Could you please report this in our bugtracker?

Re: ApplicationCommands.Cut not reacting on selection in TextBox

Posted: 06 Jun 2023, 15:14
by Umarsh
Could you please report this in our bugtracker?
Reported. Thank you for the quick response.