This works.
<Setter Property="Width" Value="300" />
<Setter Property="Height" Value="300" />
But When I change that, does not work.
<Setter Property="Width" Value="{Binding ImageSize, Mode=TwoWay}" />
<Setter Property="Height" Value="{Binding ImageSize, Mode=TwoWay}" />
and declare
private Int32 imageSize;
public Int32 ImageSize
{
get { return imageSize; }
set
{
imageSize = value;
NotifyPropertyChanged("ImageSize");
}
}
What is wrong?
The most likely cause is a problem with the binding, and specifically the DataContext
. I'd recommend looking in the Output window for binding errors (they will not be raised as standard exceptions, but will be captured in the Output window for debugging purposes). The binding errors should point you in the right direction as far as what WPF recognizes as the DataContext
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With