I would like to make my application on windowsphone remember that I have checked a checkbox the next time it starts. How can I do that by Databinding or MVVM ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your
View/XAMLyou will have aCheckBoxWhen you
check/uncheckvalue you are basically playing withIsCheckedproperty ofCheckboxIn the
ViewModelcreate a property let’s sayIsCheckedand bind the value of checkbox’s checked property like this. This property will be bound to Checkbox in View or in other words CheckBox’s IsChecked property will be set using this propertyBased On Comment
You will put code above in XAML which is View in MVVM terms and in the ViewModel you will create a Property like this
I would suggest you to follow some basic tutorials like Creating your first MVVM silverlight application on windows phone 7.