Umarsh
Topic Author
Posts: 3
Joined: 05 Jun 2023, 14:31

ApplicationCommands.Cut not reacting on selection in TextBox

05 Jun 2023, 14:54

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" />
 
User avatar
sfernandez
Site Admin
Posts: 3064
Joined: 22 Dec 2011, 19:20

Re: ApplicationCommands.Cut not reacting on selection in TextBox

06 Jun 2023, 14:09

Could you please report this in our bugtracker?
 
Umarsh
Topic Author
Posts: 3
Joined: 05 Jun 2023, 14:31

Re: ApplicationCommands.Cut not reacting on selection in TextBox

06 Jun 2023, 15:14

Could you please report this in our bugtracker?
Reported. Thank you for the quick response.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 13 guests