This code is in my class constructor:
CheckBox autoScrollCheckBox = new CheckBox();
autoScrollCheckBox.VerticalAlignment = VerticalAlignment.Center;
autoScrollCheckBox.Content = "Enable";
Binding autoScrollBinding = new Binding();
autoScrollBinding.Path = new PropertyPath("AutoScrollingIsEnabled");
autoScrollBinding.RelativeSource = new RelativeSource(RelativeSourceMode.Self);
autoScrollBinding.Mode = BindingMode.TwoWay;
autoScrollCheckBox.SetBinding(CheckBox.IsCheckedProperty, autoScrollBinding);
autoScrollBox.Content = autoScrollCheckBox;
This is in the same class:
public bool AutoScrollingIsEnabled
{
get
{
return !autoScrollingIsPaused;
}
set
{
autoScrollingIsPaused = !value;
}
}
But AutoScrollingIsEnabled is never called. What is the problem?