[英]Custom WinUI 3 C++/WinRT Control in C# WinUI project
I am trying to create WinUI C++/WinRT Component containing XAML control and iclude this custom control inside C# WinUI 3 project.我正在尝试创建包含 XAML 控件的 WinUI C++/WinRT 组件,并将此自定义控件包含在 C# WinUI 3 项目中。 Is this somehow possible?这有可能吗? I had no luck yet.我还没有运气。 Could you please provide some examples if this is possible?如果可能的话,你能提供一些例子吗?
Since WinUI 3 does not offer media player I want to make media player like this: https://github.com/asklar/WinAppSDK-MediaPlayer由于 WinUI 3 不提供媒体播放器,我想制作这样的媒体播放器: https://github.com/asklar/WinAppSDK-MediaPlayer
So far I found WinRT APIs not supported in .NET 5 or later .到目前为止,我发现.NET 5 或更高版本不支持 WinRT API 。 I found there Windows.UI.Xaml (all classes in this namespace) which seems to be needed for creating custom c++/winrt control.我在那里找到了Windows.UI.Xaml(此命名空间中的所有类) ,这似乎是创建自定义 c++/winrt 控件所必需的。 After I read this I assume that it is not possible to consume custom C++/WinRT WinUI control in C# WinUI project.阅读本文后,我假设无法在 C# WinUI 项目中使用自定义 C++/WinRT WinUI 控件。
Those are steps I created that projects.这些是我创建该项目的步骤。
What I found possible is to consume custom C# WinUI contron inside WinUI C++/WinRT project, which seems to be way to go for me.我发现可能的是在 WinUI C++/WinRT 项目中使用自定义 C# WinUI contron,这对我来说似乎是 go 的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.