Freezable.CreateInstanceCore Freezable.CreateInstanceCore Freezable.CreateInstanceCore Freezable.CreateInstanceCore Method

定义

在派生类中实现时,将创建的新实例Freezable派生的类。When implemented in a derived class, creates a new instance of the Freezable derived class.

protected:
 abstract System::Windows::Freezable ^ CreateInstanceCore();
protected abstract System.Windows.Freezable CreateInstanceCore ();
abstract member CreateInstanceCore : unit -> System.Windows.Freezable
Protected MustOverride Function CreateInstanceCore () As Freezable

返回

新实例。The new instance.

示例

下面的示例演示的典型实现CreateInstanceCoreThe following example shows a typical implementation of CreateInstanceCore.

public class MyFreezable : Freezable
{
    // Typical implementation of CreateInstanceCore
    protected override Freezable CreateInstanceCore()
    {
    
        return new MyFreezable();      
    }


    // ...
    // Other code for the MyFreezableClass.
    // ...
    
    
}

Public Class MyFreezable
	Inherits Freezable
	' Typical implementation of CreateInstanceCore
	Protected Overrides Function CreateInstanceCore() As Freezable

		Return New MyFreezable()
	End Function


	' ...
	' Other code for the MyFreezableClass.
	' ...


End Class

注解

请勿调用此方法,直接 (但调用基实现中)。Do not call this method directly (except when calling base in an implementation). 在内部调用此方法CreateInstance方法时的新实例Freezable创建。This method is called internally by the CreateInstance method whenever a new instance of the Freezable is created.

继承者说明

每个Freezable派生的类必须实现此方法。Every Freezable derived class must implement this method. 一个典型的实现是只需调用默认构造函数,并返回结果。A typical implementation is to simply call the default constructor and return the result.

适用于

另请参阅