本文整理汇总了C#中System.Windows.FrameworkElement.RaiseEvent方法的典型用法代码示例。如果您正苦于以下问题:C# FrameworkElement.RaiseEvent方法的具体用法?C# FrameworkElement.RaiseEvent怎么用?C# FrameworkElement.RaiseEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.FrameworkElement
的用法示例。
在下文中一共展示了FrameworkElement.RaiseEvent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RaiseLoadedEvent
/// <summary>
/// Raises the loaded event.
/// </summary>
/// <param name="xamlObject">The xaml object.</param>
private static void RaiseLoadedEvent(FrameworkElement xamlObject)
{
xamlObject.RaiseEvent(LoadedEventArgs);
LogicalTreeHelper
.GetChildren(xamlObject)
.Cast<FrameworkElement>()
.ForEach(RaiseLoadedEvent);
}
示例2: EventTriggerBasicTest
public void EventTriggerBasicTest()
{
EventTrigger trigger = new EventTrigger { RoutedEvent = Event1Event };
trigger.Actions.Add(new Setter { Property = new DependencyPropertyPathElement(Value1Property), Value = 1 });
FrameworkElement element = new FrameworkElement();
Assert.AreEqual(0, element.GetValue(Value1Property));
element.Triggers.Add(trigger);
Assert.AreEqual(0, element.GetValue(Value1Property));
element.RaiseEvent(new RoutedEventArgs(Event1Event, element));
Assert.AreEqual(1, element.GetValue(Value1Property));
element.Triggers.Remove(trigger);
Assert.AreEqual(0, element.GetValue(Value2Property));
}
示例3: SendBubbledEvent
private bool SendBubbledEvent(FrameworkElement target, Command command, object args)
{
var routedEvent = new CommandRoutedEventArgs(InputCommands.CommandSentEvent, _presentationManager.ActiveWindow)
{
Command = command,
Args = args
};
target.RaiseEvent(routedEvent);
return routedEvent.Handled;
}
示例4: RaiseUpdateRequested
public static void RaiseUpdateRequested(FrameworkElement eventSource)
{
eventSource.RaiseEvent(new RoutedEventArgs(UpdateRequested));
}
示例5: RaiseRenderingFinished
public static void RaiseRenderingFinished(FrameworkElement eventSource)
{
eventSource.RaiseEvent(new RoutedEventArgs(RenderingFinished));
}