类似于非XAML的DependencyObject [英] Something like DependencyObject for non XAML

查看:58
本文介绍了类似于非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组件中),请阅读  这个


这篇关于类似于非XAML的DependencyObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆