简体   繁体   English

有人可以向我展示如何在Silverlight XAML中设置样式的单选按钮以使其聚焦时(或更改其颜色)吗?

[英]Can someone show me how to style a radiobutton in Silverlight XAML to outline it (or change it's color) when it get's focus?

I have a radiobutton VisualStateGroup for Focuses, but I don't know how to change the storyboard to highlight the radiobutton on focus. 我有一个用于焦点的单选按钮VisualStateGroup,但是我不知道如何更改情节提要以突出显示焦点上的单选按钮。

 <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>

I worked it out. 我解决了。 It turns out the the target element needed to be layered on top of the other elements. 事实证明,目标元素需要在其他元素之上分层。

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

相关问题 有人可以帮助我理解为什么选择 RadioButton 时我的 TextBox 的占位符没有改变吗? - Can someone help me understand why my TextBox's placeholder doesn't change when RadioButton selected? 如何更改来自XAML中的DataTemplate的第一个孩子的样式? - How to change the first child's style coming from a DataTemplate in XAML? 如何在Silverlight中以编程方式分别更改列表框项目的颜色? - How to change listbox item's color individually programmatically in silverlight? 如何在XAML样式文件中更改颜色 - How to change a color in a XAML style file 我可以更改radiobutton控件的可见性 - Can I change radiobutton control's visibility WPF XAML是否基于SystemColor.HighlightBrushKey的不透明度更改颜色? - WPF XAML Change Style color based on SystemColor.HighlightBrushKey 's opacity? 当GridSplitter聚焦在Silverlight 4中时,如何更改样式 - How to change a style when GridSplitter is focused in Silverlight 4 在Silverlight中检测控件的焦点 - Detecting a control's focus in Silverlight 获得焦点后如何更改TextBox的背景? - How to change TextBox's background when it got focus? 有人能告诉我这段代码有什么问题吗? - Can someone tell me what's wrong with this code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM