I want to create a static class where I will have some common methods which I will using in events. So for example I did a following class:
public static class CommonMethodsProvider {
public static void CommonEventHandler( object sender, MouseButtonEventArgs e ) {
// ...
}
}
And in xaml code I tried to do it like that:
<... Handler="CommonMethodsProvider.CommonEventHandler" ... />
Is there any way to use it in WPF controls?
I receive error:
PreviewMouseLeftButtonDown="CommonMethodsProvider.CommonEventHandler" is not valid. 'CommonMethodsProvider.CommonEventHandler' is not a valid event handler method name. Only instance methods on the generated or code-behind class are valid.
So isn't there any opportunity to do it?