我实验了,在本userControl中订阅自己的事件没有问题的。但是在父UserControl中订阅的事件却没有捕捉到!请问各位谁知道这是怎么回事儿?
事件定义如下:
public static readonly RoutedEvent DictSelectedEvent = EventManager.RegisterRoutedEvent("DictSelected", RoutingStrategy.Bubble , typeof(DictEventHandler), typeof(DictionarySelector)); public event DictEventHandler DictSelected { add { AddHandler(DictSelectedEvent, value); } remove { RemoveHandler(DictSelectedEvent, value); } }
找到问题了,是个低级错误 :(