Reputation: 85
I have a control checkbox that allows the app to play sounds (SoundEnableBox) when it is checked. If they uncheck it I want it to stay unchecked (So I need to programmadigally uncheck the box when the page is reloaded. The default is set to checked. Every time the page is reloaded it gets checked again.
I tried the following code but it is not working. Do I need to bind the property? to keep it unchecked?
if (GlobalVariables.SoundsEnabled.GlobalBool == false)
{
SoundsEnabledBox.Unchecked = true;
}
I know this should be simple but not with windows phone for some reason.
Upvotes: 0
Views: 243
Reputation: 85
After looking at this for a short while I decided to change the default to unchecked and wrote the following logic to correct the issue I was having.
if (GlobalVariables.SoundsEnabled.GlobalBool == false)
{
SoundsEnabledBox.IsChecked = false;
}
else if (GlobalVariables.SoundsEnabled.GlobalBool == true)
{
SoundsEnabledBox.IsChecked = true;
}
Upvotes: 0