samrrr
Topic Author
Posts: 12
Joined: 05 Jul 2022, 12:39

Copy/Paste Commands in XAML

06 Apr 2023, 11:23

            <TextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem
                        Header="{Binding Source=#Translatable:MenuCut, Converter={StaticResource LocalizationConverter}}"
                        Command="Cut">
                    </MenuItem>
                    <MenuItem
                        Header="{Binding Source=#Translatable:MenuCopy, Converter={StaticResource LocalizationConverter}}"
                        Command="Copy">
                    </MenuItem>
                    <MenuItem
                        Header="{Binding Source=#Translatable:MenuPaste, Converter={StaticResource LocalizationConverter}}"
                        Command="Paste">
                    </MenuItem>
                </ContextMenu>
            </TextBox.ContextMenu>
            
In WPF work but in Noesis 3.1.5 this:
NOESIS E ../data/nassets/UI/Screens/ProfileNameDialog.xaml(230): Unable to convert 'Cut' to a valid value for property MenuItem.Command.
NOESIS E ../data/nassets/UI/Screens/ProfileNameDialog.xaml(234): Unable to convert 'Copy' to a valid value for property MenuItem.Command.
NOESIS E ../data/nassets/UI/Screens/ProfileNameDialog.xaml(238): Unable to convert 'Paste' to a valid value for property MenuItem.Command.
How fix this error?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Copy/Paste Commands in XAML

11 Apr 2023, 14:35

The Cut/Copy/Paste commands are part of the ApplicationCommands class. It seems that WPF supports omiting the class for those commands, we should support that, could you please report it in our bugtracker?

In the meantime you can provide the class name to make it work in Noesis too:
    <ContextMenu>
      <MenuItem Command="ApplicationCommands.Cut"/>
      <MenuItem Command="ApplicationCommands.Copy"/>
      <MenuItem Command="ApplicationCommands.Paste"/>
    </ContextMenu>
 
samrrr
Topic Author
Posts: 12
Joined: 05 Jul 2022, 12:39

Re: Copy/Paste Commands in XAML

17 Apr 2023, 10:36

With ApplicationCommands. this work in noesis thanks.

I dont know this bug on not. If you know this a bug 100% then you can post in bugtracker.
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Copy/Paste Commands in XAML

19 Apr 2023, 16:37

We implemented support for specifying only the name for ApplicationCommands and ComponentCommands: #2574

Who is online

Users browsing this forum: No registered users and 5 guests