Getting a XamlParse Exception when using a userbaseclass with a UserControl
I have an abstract base class that subclasses the UserControl class with no XAML. When I create a class based on the base class everything works fine (compiles and executes). But when I add code to the base class to fire an event, it compiles but when run I get a 'The invocation of the constructor on type 'ExtendedDisplay.UserControls.Annotations' that matches the specified binding constraints threw an exception.' error. Not sure why.
Here is my code for the base class,

public abstract class BaseClass: UserControl
{
      protected static System.Type ControlType;

      public static readonly RoutedEvent RefreshEvent = EventManager.RegisterRoutedEvent(
           "RefreshEvent",
           RoutingStrategy.Bubble,
           typeof(RefreshEventHandler),
           ControlType);

      public delegate void RefreshEventHandler(object sender, RefreshEventArgs e);

      public event RefreshEventHandler RefreshNeeded
      {
          add { AddHandler(RefreshEvent, value); }
          remove { RemoveHandler(RefreshEvent, value); }
      }

      protected void RaiseRefreshEvent(RoutedEventArgs e)
      {
          RaiseEvent(new RefreshEventArgs(RefreshEvent, this));

          e.Handled = true;
      }

      public class RefreshEventArgs : RoutedEventArgs
      {
          public RefreshEventArgs(RoutedEvent routedEvent, object source)
                : base(routedEvent, source) { }
      }
}

This code works as expected when hardcoded into the UserControl. Any ideas/help would be greatly appreciated.
Bob 

Getting a XamlParse Exception when using a userbaseclass with a UserControl
===

I have an abstract base class that subclasses the UserControl class with no XAML. When I create a class based on the base class everything works fine (compiles and executes). But when I add code to the base class to fire an event, it compiles but when run I get a 'The invocation of the constructor on type 'ExtendedDisplay.UserControls.Annotations' that matches the specified binding constraints threw an exception.' error. Not sure why.
Here is my code for the base class,

public abstract class BaseClass: UserControl
{
      protected static System.Type ControlType;

      public static readonly RoutedEvent RefreshEvent = EventManager.RegisterRoutedEvent(
           "RefreshEvent",
           RoutingStrategy.Bubble,
           typeof(RefreshEventHandler),
           ControlType);

      public delegate void RefreshEventHandler(object sender, RefreshEventArgs e);

      public event RefreshEventHandler RefreshNeeded
      {
          add { AddHandler(RefreshEvent, value); }
          remove { RemoveHandler(RefreshEvent, value); }
      }

      protected void RaiseRefreshEvent(RoutedEventArgs e)
      {
          RaiseEvent(new RefreshEventArgs(RefreshEvent, this));

          e.Handled = true;
      }

      public class RefreshEventArgs : RoutedEventArgs
      {
          public RefreshEventArgs(RoutedEvent routedEvent, object source)
                : base(routedEvent, source) { }
      }
}

This code works as expected when hardcoded into the UserControl. Any ideas/help would be greatly appreciated.
Bob 
