SourceChangedEventArgs 类


为 SourceChanged 事件提供数据以用于互操作。Provides data for the SourceChanged event, used for interoperation. 此类不能被继承。This class cannot be inherited.

public ref class SourceChangedEventArgs sealed : System::Windows::RoutedEventArgs
public sealed class SourceChangedEventArgs : System.Windows.RoutedEventArgs
type SourceChangedEventArgs = class
    inherit RoutedEventArgs
Public NotInheritable Class SourceChangedEventArgs
Inherits RoutedEventArgs


SourceChanged 事件是一个路由事件,其中事件标识符不公开公开。The SourceChanged event is a routed event where the event identifier is not publicly exposed. 这是因为此事件在互操作中扮演着潜在的关键部分,因此不能被任何其他源(而不是 (当前的已知子类的内部实现)随意引发 PresentationSource ,只是 HwndSource) 此类。This is because this event plays a potentially critical part in interoperation and should not be allowed to be raised arbitrarily by any other source than the internal implementation of a known PresentationSource subclass (currently, the only such class is HwndSource). 实现互操作解决方案时,可以通过调用和分别) 来附加或删除事件 (的处理程序, AddSourceChangedHandler RemoveSourceChangedHandler 但不能执行通常可用于路由事件的其他操作,例如类处理、添加所有者或从任意元素源引发事件。When implementing an interoperation solution, you can attach or remove handlers for the event (by calling AddSourceChangedHandler and RemoveSourceChangedHandler, respectively) but you cannot perform other operations normally available to routed events such as class handling, adding owners, or raising the event from an arbitrary element source.

此类将重写 RoutedEventArgs 虚拟方法,以便在 RoutedEventArgs.InvokeEventHandler 事件系统请求时返回特定于类型的处理程序。This class overrides the RoutedEventArgs virtual method RoutedEventArgs.InvokeEventHandler, in order to return a type-specific handler when requested by the event system. SourceChangedEventArgs 替代不会出现在此 SDK 文档的类成员表中,因为它是由密封类实现的受保护成员。This SourceChangedEventArgs override does not appear in the class members table in this SDK documentation because it is a protected member implemented by a sealed class.


SourceChangedEventArgs(PresentationSource, PresentationSource)

使用为旧源和新源提供的信息初始化 SourceChangedEventArgs 类的新实例。Initializes a new instance of the SourceChangedEventArgs class, using supplied information for the old and new sources.

SourceChangedEventArgs(PresentationSource, PresentationSource, IInputElement, IInputElement)

通过使用为旧源和新源提供的信息、此更改影响的元素以及以前报告的该元素的父项,初始化 SourceChangedEventArgs 类的一个新实例。Initializes a new instance of the SourceChangedEventArgs class, using supplied information for the old and new sources, the element that this change effects, and the previous reported parent of that element.



获取一个元素,其父项更改导致表示源信息发生更改。Gets the element whose parent change causing the presentation source information to change.


获取或设置一个值,该值指示针对路由事件(在其经过路由时)的事件处理的当前状态。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

(继承自 RoutedEventArgs)

获取此源更改中涉及的新源。Gets the new source involved in this source change.


获取元素以前的父项,该元素的父项更改导致表示源信息发生更改。Gets the previous parent of the element whose parent change causing the presentation source information to change.


获取此源更改中涉及的旧源。Gets the old source involved in this source change.


在父类进行任何可能的 Source 调整之前,获取由纯命中测试确定的原始报告源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

(继承自 RoutedEventArgs)

获取或设置与此 RoutedEventArgs 实例关联的 RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance.

(继承自 RoutedEventArgs)

获取或设置对引发事件的对象的引用。Gets or sets a reference to the object that raised the event.

(继承自 RoutedEventArgs)



确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InvokeEventHandler(Delegate, Object)

当在派生类中重写时,提供特定于类型的调用事件处理程序的方式,该方式与基实现相比可提高效率。When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.

(继承自 RoutedEventArgs)

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)

在派生类中重写时,每当实例的 Source 属性的值发生更改,则提供一个通知回调入口点。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.

(继承自 RoutedEventArgs)

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)