I'm trying to make a checkbox bind to a subclass of my ViewModel class (without much luck).
In my ViewModel class...
public class TestClass
{
private bool _TestValue;
public bool TestValue
{
get { return _TestValue; }
set
{
_TestValue = value;
System.Windows.MessageBox.Show("TestValue = " + _TestValue);
}
}
}
public TestClass TC;
In my ViewModel constructor...
TC = new TestClass();
TC.TestValue = false;
In my View...
<CheckBox IsChecked="{Binding Path=TC.TestValue, Mode=TwoWay}">Option 1</CheckBox>
My expectation is that when I toggle the checkbox I should see windows popping up that say "TestValue = True" or "TestValue = False", but that doesn't happen. What am I missing?