如何在Windows Phone 8.1的XAML中复选框为IsChecked时更改复选框的背景颜色 [英] How to change background color of checkbox when checkbox is IsChecked in XAML in windows phone 8.1
本文介绍了如何在Windows Phone 8.1的XAML中复选框为IsChecked时更改复选框的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么办法改变复选框的背景颜色在xaml不是c#。我知道有检查
和未检查
事件,但我必须在Xaml中使用。
我已经参考它的模板,但是找不到解决方案。请帮助我
Is there any way to change check box background color in xaml not c# . I know there are Checked
and UnChecked
event .but I have to use in Xaml .
I have refer its template but can't find the solution . please help me for that
谢谢
推荐答案
在故事板中添加以下动画以在选中时更改复选框的背景:
Add the following animation inside the storyboard to change the background of the checkbox when checked:
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="Grid">
<DiscreteObjectKeyFrame KeyTime="0"
Value="#FFABCDEF" /> // argb value of your desired background color
</ObjectAnimationUsingKeyFrames>
这篇关于如何在Windows Phone 8.1的XAML中复选框为IsChecked时更改复选框的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文