Skip to main content

Microsoft Silverlight

Answered Question Checkbox doesn't "refresh" when datacontext changed?RSS Feed

(0)

mtiede@swtechnologies.com
mtiede@s...

Member

Member

148 points

275 Posts

Checkbox doesn't "refresh" when datacontext changed?

I have a checkbox on a navigation page that I have bound to a field in the datacontext.  I modify one textbox and one checkbox control.  When I press a button, I go to WCF and get new data and then replace the datacontext of the page.  The textbox text changes, but the checkbox ischecked property remains whatever it was before I pressed the button.  Is IsChecked NOT the thing to bind to the data?

Oh, the field that is being bound to the checkbox is a nullable boolean (if that makes any difference).  The textbox that works is bound to a nullable string.

mtiede@swtechnologies.com
mtiede@s...

Member

Member

148 points

275 Posts

Answered Question

Re: Checkbox doesn't "refresh" when datacontext changed?

 I ended up changing the IsThreeWay="True", but that didn't help.  Then I added Mode=TwoWay to the binding.  Then it worked right.

 I guess I am surprised that TextBox worked without saying the Mode, but CheckBox required it, I guess.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities