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

WPF Commanding problem

Why commanded control is always disabled however command can be executed? Command also runs with Alt + F4 public static class CommandLibrary { static CommandLibrary() { ShutDownCommand = new RoutedUICommand("Exit", "Exit",…
Sadegh
  • 4,181
  • 9
  • 45
  • 78
0
votes
1 answer

Binding to command with parameter in style setter WPF

I have an desktop app writen in WPF, which has a control that operates on dynamically created tabs. I've binded the CloseTabCommand to the CloseCommand property of the control via style setter.