开发者

How to raise Onload/OnUnload event from FrameworkElement for unit testing purposes?

As you can see here, I can't use reflection to get the multicast delegates of the private开发者_JAVA技巧 fields behind these FrameworkElement events because they aren't field-like. So how to do it?


Please try this:

yourControl.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent));

It should work! :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜