FrameworkContentElement.BeginInit 方法


已在初始化元素之前调用。Called before an element is initialized.

 virtual void BeginInit();
public virtual void BeginInit ();
abstract member BeginInit : unit -> unit
override this.BeginInit : unit -> unit
Public Overridable Sub BeginInit ()



重写此方法以提供在元素加载过程中初始化元素之前应发生的特殊处理。Override this method to provide special handling that should occur before your element is initialized during the element loading process.

你的实现应调用基实现,因为基础 (默认值) 实现设置某些内部标志以跟踪初始化。Your implementation should call the base implementation, because the base (default) implementation sets some internal flags to keep track of initialization.

如果在 BeginInit() 到达之前调用了同一元素上的多个时间,则基实现将引发异常 EndInit()The base implementation will throw an exception if BeginInit() is called more than one time on the same element prior to reaching EndInit().