Skip to content

How to add custom WinRT type mapping in .NET Framework #5943

@Gaoyifei1011

Description

@Gaoyifei1011

How to add custom WinRT type mapping in .NET Framework

--------------------------------------------------

如何在 .NET Framework 中添加自定义WinRT类型映射


.NET Core 中,CsWinRT 已经添加了 WinUI 3(对应 Microsoft.* )命名空间和 UWP (对应 Windows.*)命名空间的类型映射支持。在 .NET Framework 中,对 UWP (对应 Windows.*)命名空间的类型映射是在 .NET Framework 内部中,如何增加对 WinUI 3(对应 Microsoft.* )命名空间类型映射支持?

--------------------------------------------------

In .NET Core, CsWinRT has added type mapping support for the WinUI 3 (corresponding to Microsoft.*) namespace and the UWP (corresponding to Windows.*) namespace. In the .NET Framework, type mapping for the UWP (corresponding to Windows.*) namespace is carried out within the .NET Framework. How can support for type mapping of the WinUI 3 (corresponding to Microsoft.*) namespace be added?


比如(For example)

Microsoft.UI.Xaml.Input.ICommand -> System.Windows.Input.ICommand
Microsoft.UI.Xaml.Data.INotifyCollectionChanged -> System.Collections.Specialized
Microsoft.UI.Xaml.Data.INotifyDataErrorInfo -> System.ComponentModel.INotifyDataErrorInfo
......

这是我的 WinUI 3 with .NET Framework 实现

--------------------------------------------------

This is my WinUI 3 with .NET Framework implementation


https://github.com/[Gaoyifei1011/WinUI3NETFramework(https://github.com/Gaoyifei1011/WinUI3NETFramework)


Reference link
https://learn.microsoft.com/zh-cn/windows/apps/develop/platform/csharp-winrt/net-mappings-of-winrt-types
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions