Home › Forums › Software Development › WPF problems with Behavior.GazeAware binding
- This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by Martin Krizek.
- AuthorPosts
- 22/03/2015 at 09:18 #2726Martin KrizekParticipant
Hi,
in WPF I have two elements and I want that both could be “active” (firingHasGazeChanged
) only in certain conditions. So in one element I seteyeX:Behavior.GazeAware
through binding (I also tried to setUpdateSourceTrigger=PropertyChanged
) and in the other one I seteyeX:Behavior.GazeAware
throughDiscreteBooleanKeyFrame
inAnimation
.
But it seems that both ways fails because both elements don’t react at all. When I set theirseyeX:Behavior.GazeAware
toTrue
directly in XAML, both elements works. Can you please help me solve this issue?23/03/2015 at 17:36 #2732Patrik [Tobii]ParticipantHello Martin,
Would it be possible for you to provide a minimal sample showing the problem you’re experiencing?
Best regards
Patrik Svensson23/03/2015 at 19:52 #2736Martin KrizekParticipantHello Patrik,
Thanks for quick response.
If I use your example “GazeAwareElements”. Add to “EyeXGazeAwareButton” style these setters:<Setter Property="Opacity" Value="0.5" /> <Setter Property="eyeX:Behavior.GazeAware" Value="False" />
And this
Animation
toStyle.Triggers
:<EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard> <Storyboard AutoReverse="True" RepeatBehavior="Forever"> <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(eyeX:Behavior.GazeAware)"> <DiscreteBooleanKeyFrame KeyTime="0:0:1.5" Value="True" /> </BooleanAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"> <SplineDoubleKeyFrame KeyTime="0:0:1.5" Value="0.5" /> <SplineDoubleKeyFrame KeyTime="0:0:5.5" Value="1" KeySpline="0.75,0,0.5,1" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger>
For binding:
If you add for exampleCheckBox
intoGrid
:
<CheckBox Name="MyCheckBox" Content="Allow gaze" IsChecked="True" />
And changeStackPanel
:<StackPanel Grid.Row="1" Grid.Column="1" Style="{StaticResource EyeXGazeAwarePanel}" eyeX:Behavior.GazeAware="{Binding ElementName=MyCheckBox, Path=IsChecked, UpdateSourceTrigger=PropertyChanged}">
- AuthorPosts
- You must be logged in to reply to this topic.