xamlwinrt-xamlwinui-3

How can I find namespace in xaml?


If you look at SettingsPage.xaml in a project created by TemplateStudio, you will find the following code: It doesn't work if I write the same code on the project I created without TemplateStudio. How can I find namespace Microsoft.UI.Xaml?

I'm working on the WinUI3 project.

<Page xmlns:xaml="using:Microsoft.UI.Xaml">
    <RadioButton>
        <RadioButton.CommandParameter>
            <xaml:ElementTheme>Light</xaml:ElementTheme>
        </RadioButton.CommandParameter>
    </RadioButton>
</Page>

Solution

  • Refer to the Doc: Download and install the Windows UI Library

    In the NuGet Package Manager, select the Browse tab and search for Microsoft.UI.Xaml or WinUI. Select which Windows UI Library NuGet Packages you want to use (the Microsoft.UI.Xaml package contains Fluent controls and features suitable for all apps). Click Install.