Search code examples
c#.netuwpwinui-3windows-app-sdk

Is Windows App SDK related/connected to UWP?


I started working on a small hobby Windows App using WinUI 3 and Windows App SDK. As the title suggests, I would like to know how to efficiently "Google it", specifically for the Windows App SDK part.

Like for example when I would like to know how to get the Text from a TextBox in WPF I would search "WPF How to get text from textbox" or something in that manner, you get the idea

The problem now is that when trying this like "Windows App SDK How to get text from Textbox" the search yielded less rich results.

I'm fairly new to building Windows Apps, but I've found that when searching for answers using "UWP" instead of "Windows App SDK" in my searches, I received better results that actually ended up working for my project.

Like when trying to copy plain text to the Clipboard, in WPF I can just use

string textToCopy = "This is the text to copy";
Clipboard.SetText(textToCopy);

Whereas in UWP I'm bound to use a DataPackage like:

string textToCopy = "This is the text to copy";
var dataPackage = new DataPackage();
dataPackage.SetText(textToCopy);
Clipboard.SetContent(dataPackage);

So I wonder, does Windows App SDK work with the same Application Models as UWP in the core?


Solution

  • WinUI 3 is next generation of UI Framework. Since it is an emerging technology, Google results are not well presented. WinUI 3 is very similar to UWP. XAML codes can be said to be 99% identical. C# codes are almost 90% identical (in my personal opinion). And the remaining 10% is different because some APIs have changed and some are new also UWP APIs start with Windows.* and WinUI 3 APIs start with Microsoft.* namespace. so you can search for WinUI 3, If you don't get any results, you can search for uwp, In this case, xaml is same, but you will need to change the c# code a little, such as changing the namespaces