views:

12

answers:

1

Hello,

I am using a base class to my Popup windows on a WPF application. Everything looks and works great beside one thing : I cant map an event handler that is on the base class to the xaml.

Ofcourse i can easily have the event on the implemented class, and use the method to call the base class, but i just wanted to know if there a way to have the code cleaner while implementing all my generic event handlers in one place and mapping the xamls to them.

Example code :

<CommandBinding Command="Save" Executed="Save_Executed" CanExecute="Save_CanExecute" />

And have Save_Executed handler on the base class of 'MyClass.cs'.

Thanks, Oran

A: 

Solved my issue through a different approach...

No need to use xaml mapping. i just added my base class a routine to register button events through code :

        CommandBinding saveBinding = new CommandBinding(ApplicationCommands.Save, Save_Executed, Save_CanExecute);
        _saveButton.CommandBindings.Add(saveBinding);

Ofcourse that _saveButton is the actual implmemented popup window button that is passed to the base class on initialization.

Oran

OrPaz