hi,
I've created a simple tester where i use a button to enable/disable a ToggleButton
when the ToggleButton control does not contain anything - all works properly
however , adding sub controls to it (in our case i just added a StackPanel)- An exception is raised:
"Value does not fall within the expected range" - right after NotifyOfPropertyChange() is called
here is the problematic view i'm using:
private bool _hasvalue;
thanks
ofer
I've created a simple tester where i use a button to enable/disable a ToggleButton
when the ToggleButton control does not contain anything - all works properly
however , adding sub controls to it (in our case i just added a StackPanel)- An exception is raised:
"Value does not fall within the expected range" - right after NotifyOfPropertyChange() is called
here is the problematic view i'm using:
<StackPanel>
<ToggleButton x:Name="SayHello" Grid.Column="1" IsEnabled="{Binding HasValue}" Height="190">
<StackPanel x:Name="sp"> </StackPanel>
</ToggleButton>
<Button x:Name="Click"></Button>
</StackPanel>
the view model:private bool _hasvalue;
public bool HasValue
{
get { return _hasvalue; }
set
{
_hasvalue = value;
NotifyOfPropertyChange(() => HasValue);
}
}
public void Click()
{
HasValue = !HasValue;
}
any way to workaround that one? - the platforms is WP8thanks
ofer