Home › Forums › Software Development › GazePointDataStream not firing on WPF with Tobii 4C
Tagged: 4C, gazepoint, GazePointDataStream, WPF
- This topic has 1 reply, 2 voices, and was last updated 4 years ago by
Grant [Tobii].
- AuthorPosts
- 12/09/2019 at 14:51 #11988
Tobias Lunte
ParticipantI’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”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″
xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″
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”;
}
}
}13/09/2019 at 09:38 #11989Grant [Tobii]
KeymasterHi @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. - AuthorPosts
- You must be logged in to reply to this topic.