本文整理汇总了C#中System.Windows.DependencyObject.SetDependencyObjectType方法的典型用法代码示例。如果您正苦于以下问题:C# DependencyObject.SetDependencyObjectType方法的具体用法?C# DependencyObject.SetDependencyObjectType怎么用?C# DependencyObject.SetDependencyObjectType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.DependencyObject
的用法示例。
在下文中一共展示了DependencyObject.SetDependencyObjectType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddToEventRoute
private static void AddToEventRoute(DependencyObject element, EventRoute route, RadRoutedEventArgs e)
{
CheckParameters(element, route, e);
DependencyObjectType dependencyType = element.GetDependencyObjectType();
if (dependencyType == null)
{
dependencyType = DependencyObjectType.FromSystemTypeInternal(element.GetType());
element.SetDependencyObjectType(dependencyType);
}
for (RoutedEventHandlerInfoList list = GlobalEventManager.GetDTypedClassListeners(dependencyType, e.RoutedEvent); list != null; list = list.Next)
{
for (int i = 0; i < list.Handlers.Length; i++)
{
route.Add(element, list.Handlers[i].Handler, list.Handlers[i].InvokeHandledEventsToo);
}
}
EventHandlersStore eventHandlersStore = GetEventHandlersStore(element);
if (eventHandlersStore != null)
{
List<RoutedEventHandlerInfo> list2 = eventHandlersStore[e.RoutedEvent];
if (list2 != null)
{
for (int j = 0; j < list2.Count; j++)
{
RoutedEventHandlerInfo info = list2[j];
route.Add(element, info.Handler, info.InvokeHandledEventsToo);
}
}
}
}