本文整理汇总了C#中UIElement.UninitializeTriggers方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.UninitializeTriggers方法的具体用法?C# UIElement.UninitializeTriggers怎么用?C# UIElement.UninitializeTriggers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIElement
的用法示例。
在下文中一共展示了UIElement.UninitializeTriggers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
public UIElement LoadContent(UIElement triggerParent)
{
if (_templateElement == null)
return null;
MpfCopyManager cm = new MpfCopyManager();
cm.AddIdentity(this, null);
FrameworkElement result = cm.GetCopy(_templateElement);
NameScope ns = (NameScope) cm.GetCopy(_templateElement.TemplateNameScope);
result.Resources.Merge(Resources);
if (_names != null)
foreach (KeyValuePair<string, object> nameRegistration in _names)
ns.RegisterName(nameRegistration.Key, cm.GetCopy(nameRegistration.Value));
triggerParent.UninitializeTriggers();
ICollection<TriggerBase> triggers = triggerParent.Triggers;
foreach (TriggerBase t in Triggers)
{
TriggerBase trigger = cm.GetCopy(t);
triggers.Add(trigger);
// Trigger will automatically be set-up (_initializeTriggers is initially set to true in result)
}
cm.FinishCopy();
// Setting the logical parent has to be done after the copy process has finished - else the logical parent will be overridden
foreach (TriggerBase t in triggers)
t.LogicalParent = result;
return result;
}