Kushal Maniyar
Kushal Maniyar

Reputation: 876

How to change background color of checkbox when checkbox is IsChecked in XAML in windows phone 8.1

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

Thank you

Upvotes: 0

Views: 897

Answers (1)

Chirag Shah
Chirag Shah

Reputation: 981

In the edit template style of the checkbox lookout for the x:Name="Checked" visualstate.

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> 

Upvotes: 1

Related Questions