Home Forums Software Development GazePointDataStream not firing on WPF with Tobii 4C

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11988
    Tobias Lunte
    Participant

    I’m trying to subscribe to the GazePoints from my 4C inside a WPF application.
    This works when I simply try a console app, so the tracker is capable of providing the stream. It also worked last year when I used an EyeX (though I don’t have that one on hand anymore), so there doesn’t seem to be a general conflict between the GazePointDataStream and WPF.
    However, when trying to subscribe to GazePoints from within WPF, the callback action is never called. As an alternative, I also tried to Subscribe with a custom IObserver, but that one also doesn’t call any handlers (neither OnNext, nor OnError or OnCompleted).

    Has anyone encountered this problem before or has an idea on how to solve it?

    (I’m using Tobii.Interaction v0.7.3 which I believe to be the correct package for interactive use and which worked with the EyeX last year, though it’s been 2 years since the last update.)

    Mimimal example:

    XAML:

    <Window x:Class=”MVP.MainWindow”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:d=”http://schemas.microsoft.com/expression/blend/2008&#8243;
    xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006&#8243;
    xmlns:local=”clr-namespace:MVP”
    mc:Ignorable=”d”
    Title=”MainWindow” Height=”450″ Width=”800″>
    <TextBlock Name=”Debug”>”Test”</TextBlock>
    </Window>

    Code-behind:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using Tobii.Interaction;

    namespace MVP
    {
    public partial class MainWindow : Window
    {
    public MainWindow()
    {
    InitializeComponent();
    Debug.Text=”A”;
    var host = new Host();
    Debug.Text = “B”;
    var gazeStream = host.Streams.CreateGazePointDataStream();
    Debug.Text = “C”;
    gazeStream.GazePoint((X, Y, _) =>
    {
    Debug.Text = “E”;
    Debug.Text = X.ToString(); ;
    });
    Debug.Text = “D”;
    }
    }
    }

    #11989
    Grant [Tobii]
    Keymaster

    Hi @tobl and thanks for your query. You will be pleased to know that we have produced a number of samples illustrating how to implement gaze aware controls effectively within WPF forms which you can download freely @ https://github.com/Tobii/interaction-samples

    If you check out the ‘WPFSamples’ , this should hopefully illustrate for you the correct methodology for getting your project up and running!

    Please try and do let us know if we can be of any further assistance. Best Wishes.

    If may also interest you to know that we have a newer Interaction API currently in Beta @ https://developer.tobii.com/consumer-eye-trackers-interaction-library/
    which has a more lightweight and simpler interface.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.