Questions tagged [routed-commands]

WPF: Defines a command that implements ICommand and is routed through the element tree.

The WPF implementation of ICommand is the RoutedCommand class.

The main sources of input in WPF are the mouse, the keyboard, ink, and routed commands. The more device-oriented inputs use a RoutedEvent to notify objects in an application page that an input event has occurred. A RoutedCommand is no different. The Execute and CanExecute methods of a RoutedCommand do not contain the application logic for the command, but rather they raise routed events that tunnel and bubble through the element tree until they encounter an object with a CommandBinding. The CommandBinding contains the handlers for these events and it is the handlers that perform the command.

RoutedCommand Class

Commanding Overview

170 questions
0
votes
1 answer

Is this a good case for use of RoutedCommand?

I have a WPF page that has 2 ContentControls on it. Both of the ContentControls have an image, one being much smaller than the other. When mouse over the larger image I want to show a zoomed in view on the smaller image. Something very similar to…
djschwartz
  • 1,236
  • 3
  • 14
  • 23
-1
votes
2 answers

Command's CanExecute method is called but not Execute method

I've bound a command to a button on a Ribbon control. The CanExecute method on the button gets called as expected but clicking on the button doesn't cause the Execute method to be called. The CanExecute sets the CanExecute property to true - the…
Phil Gan
  • 2,813
  • 2
  • 29
  • 38
-1
votes
2 answers

wpf Button always disabled (with CommandBinding, CanExecute=True and IsEnabled= True)

Revised: I apologize for missing some important descriptions in the first version, now the problem should be well-defined: so I'm making a toy CAD program with following views: MainWindow.xaml CustomizedUserControl.xaml CustomizedUserControl is a…
Hank
  • 23
  • 1
  • 6
-1
votes
1 answer

Expose multiple command in WPF user control

A better explanation, I hope: I have a toolbar with 3 buttons on it, all three bound to a Command (including a CommandParameter) this toolbar is used on several screens the xaml of the toolbar is exactly the same over all those screens I want to…
Inferis
  • 4,582
  • 5
  • 37
  • 47
-1
votes
1 answer

How to use Commands to react to a ListBox

I'm trying to learn Commanding and have set up a simple wpf project to use a custom command. I have a ListBox and a Button on a Window. When the ListBox has the focus and an Item is selected, I want the Button to be enabled, otherwise it should…
SezMe
  • 527
  • 8
  • 24
1 2 3
11
12