Cannot successfully create Class Handler

May 19, 2011 at 3:40 PM

I'm trying to to validation help on some DatePickers in SL4 so I want to fire a DateValidationError Event for each of them. Here's how I'm trying to register it.  

  public static readonly RoutedEventEx DatePickerDateValidationEvent =
            EventManagerEx.RegisterRoutedEvent("DateValidationError", RoutingStrategy.Bubble, typeof(EventHandler<DatePickerDateValidationErrorEventArgs>), typeof(DatePicker));

I'm calling it in the App startup like this:

       EventManagerEx.RegisterClassHandler(typeof(MainPage), DatePickerDateValidationEvent, new EventHandler<DatePickerDateValidationErrorEventArgs>(StartDatePick_DateValidationError));

 

May 19, 2011 at 3:41 PM

P.S. It compiles fine, the event just never fires.