简体   繁体   English

C# UWP 单选按钮样式

[英]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:我的 UWP 应用程序中的单选按钮默认样式有问题我使用了 Windows.UI.Xaml.Controls 中的默认单选按钮,它看起来像: 在此处输入图像描述

I read page about radiobutton at docs.microsoft and there style of radiobutton is another:我在 docs.microsoft 阅读了有关单选按钮的页面,单选按钮的样式是另一种: 在此处输入图像描述

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:我使用了 UWP 应用程序,最小版本 Windows 10 Fall Creators(16299),目标版本 Windows 10(1803,build 17134) 我的 nuget 包: 在此处输入图像描述 I can update them if need如果需要我可以更新它们

I need something like this for my radiobuttons:我的单选按钮需要这样的东西: 在此处输入图像描述

I read page about radiobutton at docs.microsoft and there style of radiobutton is another我在 docs.microsoft 阅读了有关单选按钮的页面,单选按钮的样式是另一种

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.文档样式来自WinUI库,如果你使用过Microsoft.UI.Xaml nuget,将XamlControlsResources添加到应用程序xaml中,它会自动更新单选按钮样式。

<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 Ge tting started with the Windows UI 2 Library有关详细信息,请参阅开始使用 Windows UI 2 库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM