Search code examples
c#uwpradio-buttonstyles

C# UWP radiobutton style


I have a problem with radiobutton default style at my UWP application I used default radio button from Windows.UI.Xaml.Controls and its look like: enter image description here

I read page about radiobutton at docs.microsoft and there style of radiobutton is another: enter image description here

Why my radiobutton is different? I used UWP application,min version Windows 10 Fall Creators(16299), Target version Windows 10(1803,build 17134) My nuget packages: enter image description here I can update them if need

I need something like this for my radiobuttons: enter image description here


Solution

  • I read page about radiobutton at docs.microsoft and there style of radiobutton is another

    The document style is comes from WinUI library, if you have used Microsoft.UI.Xaml nuget, and add the XamlControlsResources into application xaml, it will update radio button style automatically.

    <Application.Resources>
        <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
    </Application.Resources>
    

    And the dark theme radio button style meet your requirement. For more detail please refer Getting started with the Windows UI 2 Library