FrameworkElement.OnInitialized(EventArgs) FrameworkElement.OnInitialized(EventArgs) FrameworkElement.OnInitialized(EventArgs) FrameworkElement.OnInitialized(EventArgs) Method


引发 Initialized 事件。Raises the Initialized event. 每当在内部将 IsInitialized 设置为 true 时调用此方法。This method is invoked whenever IsInitialized is set to true internally.

 virtual void OnInitialized(EventArgs ^ e);
protected virtual void OnInitialized (EventArgs e);
abstract member OnInitialized : EventArgs -> unit
override this.OnInitialized : EventArgs -> unit
Protected Overridable Sub OnInitialized (e As EventArgs)


EventArgs EventArgs EventArgs EventArgs

包含事件数据的 RoutedEventArgsThe RoutedEventArgs that contains the event data.


此特定于 * 方法不是类处理程序挂钩。This particular On* method is not a class handler hook. 它也不是完全遵循已公共语言运行时 (CLR)common language runtime (CLR)建立的 On * 方法约定, 可以通过重写此方法而不调用基实现来取消匹配的事件。Nor does it exactly follow the established 公共语言运行时 (CLR)common language runtime (CLR) On* method convention that the matching event could be suppressed by overriding this method and not calling the base implementation.

请注意, IsInitialized属性是只读的, 因此不能将设置IsInitialized为强制初始化行为。Note that the IsInitialized property is read-only, so you cannot set IsInitialized to force initialization behavior. 设置初始化状态仅Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)适用于框架。Setting the initialization state is intended to be done only by the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) framework.


此虚方法的默认实现将引发上述事件。The default implementation of this virtual method raises the event as described above. 重写应调用基实现来保留此行为。Overrides should call the base implementation to preserve this behavior. 如果无法调用基实现, 则不会像通常是Initialized FrameworkElement派生类那样引发事件, 但也会禁止两个重要的样式和主题样式的初始化操作。此基实现实现的。If you fail to call the base implementation, not only will you not raise the Initialized event as is generally expected of a FrameworkElement derived class, but you will also suppress two important style and theme style initialization operations that are implemented by this base implementation.