Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to Persist Checkbox State when leaving and returning to page?

$
0
0


Hello my friends:

I have a page containing a checkbox, in XAML code the checkbox is set to:

IsChecked="True"

When I unchecked the checkbox, leave the page and return, the checkbox is checked again. I know this is normal behavior and I need the checkbox checked by default. But how do I keep the checkbox unchecked so that it stays unchecked despite set to IsChecked="True" in xmal? Can I override this in code when the box is unchecked?

The desire action will be: The checkbox is checked by default and remain checked, but if I unchecked it, then it also stays unchecked?

Do I have to write to MemoryCache? I was reading this but cannot find documentation that shows how to write the uncheck event to memory so that I can call it and delete the file when the user close the window.

Thanks!!




Viewing all articles
Browse latest Browse all 18858