Hi there:
I have a button bound to a command. It works ok, but if I define the Preview Execute event, even if I set e.handled = false; the command won't get executed
public MainWindow() {
InitializeComponent();
var binding = new CommandBinding(ApplicationCommands.New);
binding.Executed += NewCommand_Executed;
binding.PreviewExecuted += NewCommand_PreviewExecute;
this.CommandBindings.Add(binding);
}
private void NewCommand_PreviewExecute(object sender, ExecutedRoutedEventArgs e) {
e.Handled = false;
}
private void NewCommand_Executed(object sender, ExecutedRoutedEventArgs e) {
MessageBox.Show("New command triggered by " + e.Source.ToString());
}<Button Command="ApplicationCommands.New">New</Button></StackPanel>
Rafael
Believe you can do it, and you will!!