routed-commands Questions

6

Solved

I have this code (which works just right): <KeyBinding Key="Enter" Command="{Binding ReturnResultCommand}"> <KeyBinding.CommandParameter> <s:Boolean> True </s:Boolean> ...
Gezira asked 14/2, 2011 at 21:24

3

Solved

I and working on a project to create a WAN emulator using FreeBDS in a VMWare guest configured to route traffic between the host operating system and its normal gateway router. I plan to modify the...

3

Solved

According to my understanding of MVVM, it is a good practice to handle routed commands directly in the ViewModel. When a routed command is defined in a ViewModel as a RelayCommand (or DelegateCom...
Woke asked 23/3, 2016 at 16:16

5

Solved

I'm interested in creating commands that are available from anywhere in my WPF application. I'd like them to work in the same way as Cut, Copy, Paste and the other Application level commands, ie: ...
Machos asked 17/1, 2011 at 3:51

2

Solved

I need to implement a custom copy + cut + paste for data (not text or CSV) to be copied between grids in a WPF application. Using standard ApplicationCommands and defining CommandBinding works real...
Izzard asked 14/4, 2015 at 14:55

1

Solved

I'm trying to execute methods based on listview items data. In addition to that, the button, which triggers the command, should only be enabled, if "CanExecute" method of the listview item returns ...
Giannini asked 26/2, 2016 at 14:9

4

I have a RoutedUICommand called Comment Selection. I need to add an input gesture for this command as it is in VIsual Studio, ie. (Ctrl+K, Ctrl+C). How can I do this? Plz help me. (Keep VS function...
Implacental asked 2/2, 2010 at 5:3

2

The constructor of the RoutedCommand has "owner type" as a last argument. What is its significance? When it is used? MSDN documentation gives completely no clue about why it's needed and whether ...
Flange asked 30/5, 2009 at 18:58

1

Solved

If TL;DR: see the last paragraph. Pure WPF "suggests" putting presentation (controls, text, icons) into views and command logic (Execute, CanExecute methods) into code-behind. Besides putting logi...
Idealize asked 24/11, 2012 at 18:2

1

Solved

I'm trying to understand how to use RoutedCommands. I was under the impression that if I don't specify a CommandTarget on the Button, any focused element will receive the command. But for some reas...
Burkitt asked 31/5, 2012 at 13:3

2

Solved

I have successfully used a few custom commands using MVVM-Light, but I want my application to respond to the standard ApplicationCommands, not just at a Window level, but at a detailed item level a...
Swop asked 3/10, 2011 at 23:4

3

Solved

When using ICommands in XAML, WPF uses the CanExecute method to enable or disable controls associated with the command. But what if I am calling Execute from procedural code? Should I first check C...
Unmanly asked 4/8, 2011 at 14:19

2

Solved

Hi i have recently looked into WPF and started learning about Events and Commands. I typically use Commands on Button clicks which causes a method to Run in my "view model". Is it possible to mak...
Express asked 23/5, 2011 at 14:32

1

Solved

My problem is that I would like to handle a commands in multiple places. For instance I have my custom UserControl where a Button is bound to some command. I have a command binding in that control ...
Merciless asked 12/1, 2011 at 15:43

2

RoutedCommand and RoutedUICommand have a lot going for them. There's baked-in support for text and for keyboard gestures. You can bind a collection of RoutedUICommands to a Menu's ItemsSource and i...
Photosensitive asked 21/11, 2010 at 1:1

2

Solved

Could you please provide a sample, of how do you implement the ICommandSource interface. As I want my UserControl, which doesn't have the ability to Specify command in xaml, to have this ability. A...
Repressive asked 17/8, 2010 at 11:59

1

In a WPF / MVVM application, I am trying to find a code-efficient way to set the main view cursor to Cursors.Wait prior to any lengthy operation and to restore it to the default cursor after comple...
Slapbang asked 7/7, 2010 at 10:32

6

Solved

I am trying to get Undo/Redo keyboard shortcuts working in my WPF application (I have my own custom functionality implemented using the Command Pattern). It seems, however, that the TextBox control...
Boatel asked 3/9, 2009 at 19:36

1

Solved

Im deriving from a third party control. It is implementing ApplicationCommands.SelectAll. However the behaviour i want is slightly different. there is no virtual method i can override, and when i r...
Canso asked 15/3, 2010 at 4:36

4

Solved

I have an ICommand that I want to fire (make the execute go) from code; how do I do this?
Hersch asked 15/11, 2009 at 23:10

1

Solved

I have tried to do some reading about it, but I failed to find documentation that explains the difference between RoutedCommand and RoutedUICommand satisfactorily.
Angulate asked 18/10, 2009 at 12:3

2

Solved

Let's have a button Command property bound to a custom command. When should I implement ICommand and when derive from RoutedCommand? I see that RoutedCommand implements ICommand. In which case co...
Shrubbery asked 16/7, 2009 at 7:37

2

Items in a list have context menus. The context menu items are bound to routed commands. The context menu items work correctly if the list control is a ListBox, but as soon as I downgrade it to an...
Tolbutamide asked 7/5, 2009 at 9:6

1

Solved

The following RoutedCommand example works. However, the handling for the button which executes the command is in the codebehind of the view. The way I understand MVVM, it should be in the ViewMode...
Awhirl asked 30/4, 2009 at 7:53

4

Solved

I was talking to someone today about picking a design pattern for how to handle logic in their WPF program and hoping that the SO community can help with further advice to make the decision easier....
Nucleoplasm asked 17/2, 2009 at 19:13

© 2022 - 2024 — McMap. All rights reserved.