WPF provides two (similar) implementations for the
ICommand interface. Commands are invoked (by default) by command sources, implementing the
ICommandSource interface. These two interfaces comprise the basic abstraction WPF recognizes as far as commands are concerned. In this recipe, we'll examine these interfaces, their out-of-the-box implementations, and how they are typically used.
Make sure Visual Studio is up and running.
We'll create a simple image viewer that provides its functionality via WPF routed commands:
MainWindow.xaml. Add the following to the existing
<Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition ...