类似于非XAML的DependencyObject

类似于非XAML的DependencyObject

问题描述:

我需要在C ++和HTML / JS中创建WinRT组件作为后端。对于XAML应用程序,我可以创建一个继承自DependencyObject的基类,但我不能将它用于非XAML应用程序。我怎样才能使ref class not密封为我的其他类的基类

I need to create WinRT component in C++ and HTML/JS as a backend. For XAML apps i can make a base class inherited from DependencyObject, but i cannot use that for non XAML app. How i can make ref class NOT sealed as a base class for my other classes ?

示例:

public ref class TBase : <???>
{
};

public ref class TMyClass sealed : public TBase
{
};

public ref class THisClass sealed : public TBase
{
};

嗨  Petr
Jurik - Ventis Media

Windows运行时组件是一个可以通过使用JavaScript或C#,Visual Basic或C ++ / CX
构建的Windows应用商店应用程序调用的DLL,因此所有类型都必须密封  更多 。

Windows Runtime component is a DLL that's callable from a Windows Store app that's built by using JavaScript—or C#, Visual Basic, or C++/CX  therefore all types have to be sealed More .


如果你想在C ++ / CX应用程序中使用继承(不在WinRT组件中),请阅读  这个