我找不到为我的用户控件类型委托RoutedPropertyChangedEventHandler声明属性的语法(如滑块ValueChange处理程序)
答案 0 :(得分:1)
您正在尝试创建活动:
public event RoutedPropertyChangedEventHandler MyEvent;
但是,为了使其正常工作,您需要创建routed event
public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent(
"Tap", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyButtonSimple));
// Provide CLR accessors for the event
public event RoutedEventHandler Tap
{
add { AddHandler(TapEvent, value); }
remove { RemoveHandler(TapEvent, value); }
}