XAML RadioButton样式问题 [英] XAML RadioButton Style problem

查看:166
本文介绍了XAML RadioButton样式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个可同时更改项目符号和单选按钮边框的RadioButton.我基于MSDN论坛上的样式

http://msdn.microsoft.com/en-us/library/ms751600 (v = vs.85).aspx [
< Border BorderBrush ="Transparent" BorderThickness ="1" Background ="{DynamicResource ThemedM2DGradient}" CornerRadius ="15" Padding ="0,0,25,0">

有关RadioButton控制模板的任何建议,可让您控制BulletDecorator并让按钮围绕带有CornerRadius和Padding Set的边框?

数周以来,我一直在搜索一个示例,但未发现任何问题.

Michael

I''m trying to create a RadioButton that changes both the Bullet, and the border of the radiobutton. I''m basing the style on the on the MSDN forums

http://msdn.microsoft.com/en-us/library/ms751600(v=vs.85).aspx[^]

Essentially, I''d like the entire radiobutton background to have a rounded border (see below), similar to a Rounded Button. I tried adding the following statement around the BulletDecorator segment, but that essentially disables the RadioButton.

<Border BorderBrush="Transparent" BorderThickness="1" Background="{DynamicResource ThemedM2DGradient}" CornerRadius="15" Padding="0,0,25,0">

Any suggestions on a Control Template for a RadioButton that lets you control the BulletDecorator AND lets you wrap the button around a Border with CornerRadius and Padding Set?

I''ve been googling an example of this for weeks, and haven''t found anything.

Michael

推荐答案

我找到了解决方案.我需要将VisualStateManager部分完全移出BulletDirectorator部分.一切都解决了.


顺便说一句,上面的链接不正确.该模板来自Microsoft提供的ControlTemplateExamples示例.

只是以为我会继续下去.
I found the solution. I needed to move the VisualStateManager section completely OUT of the BulletDirectorator section. That solved everything.


BTW, the link above is incorrect. The template comes from the ControlTemplateExamples example provided by Microsoft.

Just thought I''d pass this on.


这篇关于XAML RadioButton样式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆