4

Developing for Windows with the Windows App SDK · Discussion #1615 · microsoft/W...

 2 years ago
source link: https://github.com/microsoft/WindowsAppSDK/discussions/1615
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

We hope you're excited about the new features in the Windows App SDK and WinUI 3! partying_face To help you determine when and how you should use the Windows App SDK, we’ve put together a few frequently asked questions.

What is the focus of the Windows App SDK?

The Windows App SDK is focused on empowering developers to build the most productive apps on Windows. To achieve this, we are using the existing desktop project types as the foundation of the Windows App SDK, due to the vast amount of existing desktop APIs and compatibility that desktop project types provide. Additionally, we are making our existing UWP platform investments easier to consume by desktop project types and enabling new capabilities like AI & Fluent Design. As we enable these new capabilities, we are lifting more libraries from the OS into the Windows App SDK, so we can deliver on the agility and backwards-compatibility developers need to reach across the entire Windows ecosystem.

What does the Windows App SDK mean for UWP and desktop developers?

For developers using the Universal Windows Platform (UWP) project types, if you are happy with your current functionality in UWP, there is no need to migrate your project type. WinUI 2.x and the Windows SDK will continue to support UWP project types, including bug, reliability, and security fixes. In Windows, we use UWP project types for several of our own Windows apps. If you want to use the Windows App SDK or .NET 5 in your existing app, you can migrate your project to a desktop project type as described in the migration section further below.

For developers using a desktop project type (WPF, Windows, or .NET 5+), you can simply add the Windows App SDK as a NuGet package and get access to all the new APIs.

Our goal is to make the Windows App SDK the superset of the capabilities of both desktop and UWP – which would give developers a single path forward. We are using desktop project types as the foundation of our convergence.

How should I think about the future of app development on Windows?

We are making it easier and faster to build great desktop apps via the Windows App SDK and WinUI 3, and continuing to make it easier to empower your UWP app with desktop functionality by improving the migration experience. There are many excellent choices to consider when building a new Windows app. For native Windows desktop apps, we recommend investigating WinUI 3 first and seeing if WinUI 3 meets your needs. See our roadmap and the WinUI 3 roadmap to get an idea of what’s available now and what’s coming. Please continue to engage with us and let us know what's blocking you so we can plan and prioritize your most critical features!

What if I have a UWP app and need .NET 5/6?

If you need to use .NET 5/6 in your UWP project type, we recommend you migrate your project to a WinUI 3 desktop project, since .NET 5/6 will not be coming to UWP project types. See the migration section further below for more info.

What if I want to develop an app with web content?

WebView2 provides the best way to use web content in your native Windows app. It is currently available for WinUI 3, WPF, and WinForms. WebView2 is in the process of being added to WinUI 2, and will become stable soon.

What would migrating project types from UWP to desktop look like?

If you are happy with your current functionality in UWP, there is no need to migrate your project type. WinUI 2.x and the Windows SDK will continue to support UWP project types, including bug, reliability, and security fixes.

If you’ve decided to migrate, you should first be aware of some functionality that is not yet supported in WinUI 3 and the Windows App SDK. If your app needs any of these features/libraries, you should consider waiting to migrate. UWP project types are still supported by WinUI 2.x and the Windows SDK.

When migrating, in most cases, your UI code just needs a few namespace changes. Much of your platform code will stay the same. You will need to tweak or change some code based on different functionality/availability in desktop apps vs UWP apps. We expect migrating most apps to be in the order of days rather than weeks.

At a high level, to migrate your app, you would...

  1. Create a new WinUI 3 packaged desktop project in your existing solution
  2. Copy your XAML/UI code
    1. In general, you simply change your namespaces from Windows.UI* to Microsoft.UI*
  3. Copy your app logic code
    1. You’ll find some APIs that need tweaks, like FolderPicker or SecondaryTiles, but our migration docs will cover how to migrate these APIs.

See the migration docs to learn more about how to migrate! For those of you who have migrated, please share your feedback with us so we make improvements and include issues you ran into in our documentation. Please continue to engage with us and let us know what's blocking you so we can plan and prioritize your most critical features!


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK