Situation: I have a MainView.xaml and MainViewModel.cs The view is connected to the viewmodel using caliburn micro. The binding is working, but not for that special case: If i initialize my property of type bool in my constructor to false the binding wont update to true in any case. If i initialize the prop to true there is no problem of changing it to false or true later!
The xaml file:
<Style x:Key="EyeXGazeAwareElement" TargetType="FrameworkElement">
<Setter Property="eyeX:Behavior.GazeAware" Value="{Binding IsGazeActivated}" />
<Setter Property="eyeX:Behavior.GazeAwareDelay" Value="10" />
...
<Grid HorizontalAlignment="Center" Style="{StaticResource EyeXGazeAwareElement}" Width="250"></Grid>
And in the ViewModel:
public bool IsGazeActivated { get; set; }
public MainViewModel()
{
IsGazeActivated = false;
}
private void GazeActivatedChanged()
{
//this value gets changed, but not in the xaml file...
//but only if the initial value was set to false, otherwise it is working perfect
IsGazeActivated = Setting.Instance.IsGazeActivated;
}
I already tried to use mode=twoway, changed updatesourcetrigger,... but nothing worked!
EDIT: I use PropertyChanged.Fody for weaving my properties. So there is no need to call PropertyChanged manually. The Value of eyeX:Behavior.GazeAware can ether be "True" or "False" and that should map with an bool.. and it is mapping already but not when i initialize the IsGazeActivated to false in the constructor.