Home Forums Software Development WPF problems with Behavior.GazeAware binding

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2726
    Martin Krizek
    Participant

    Hi,
    in WPF I have two elements and I want that both could be “active” (firing HasGazeChanged) only in certain conditions. So in one element I set eyeX:Behavior.GazeAware through binding (I also tried to set UpdateSourceTrigger=PropertyChanged) and in the other one I set eyeX:Behavior.GazeAware through DiscreteBooleanKeyFrame in Animation.
    But it seems that both ways fails because both elements don’t react at all. When I set theirs eyeX:Behavior.GazeAware to True directly in XAML, both elements works. Can you please help me solve this issue?

    #2732
    Patrik [Tobii]
    Participant

    Hello Martin,

    Would it be possible for you to provide a minimal sample showing the problem you’re experiencing?

    Best regards
    Patrik Svensson

    #2736
    Martin Krizek
    Participant

    Hello 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 to Style.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 example CheckBox into Grid:
    <CheckBox Name="MyCheckBox" Content="Allow gaze" IsChecked="True" />
    And change StackPanel:

    <StackPanel Grid.Row="1"
                        Grid.Column="1"
                        Style="{StaticResource EyeXGazeAwarePanel}"
                        eyeX:Behavior.GazeAware="{Binding ElementName=MyCheckBox, Path=IsChecked, UpdateSourceTrigger=PropertyChanged}">
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.