Creating A WPF ProjectFire up Visual Studio 2008, create a WPF Application, and name it as CustomCommandRoutedUI.Now let's create a static class in Window1.xaml.csAs you see in above code display, we have created a static class with 3 static readonly commands of type RoutedUICommand.Now to use it in XAML behind we need to add the namespace.Let's have three buttons such Add, Edit and Copy. Which would operate on a ListBox item.So let's do the design.The following is the reference for the XAML.Now let's have the Commands Binding for the ListBox.As you see in above XAML display we have the Commands attached and we handled two events such as CanExecute and Executed for all the Commands.Now let's set the CommandTarget and CommandParameter wherever required.Now let's have the events handled.Let's have the Add Command first.Then similarly Delete Command.And finally Copy Command.That's it. Let's run the application and see how we managed to use CustomRoutedUI Commands.Hope this article helps.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: