Home › Forums › Software Development › intermittent EyeXGazeAwareElement problem
Tagged: #WPF #C# #GazeAware
- This topic has 3 replies, 2 voices, and was last updated 8 years, 7 months ago by Hanz.
- AuthorPosts
- 07/01/2016 at 20:59 #4039HanzParticipant
Hi,
I have created a WPF form with button and web bowers element.
The button is created using UserControl.xmal as I need some styling and effect on it.The button will have EyeXGazeAwareElement whenever there a gaze.However, there was intermittent gaze aware each time I run my program. sometime the button have gaze aware and sometime it fail. Sensor is working fine.
So can anyone advise?
MainWindow.xaml
<Window x:Name="frmMessenger" x:Class="FYP.Messenger" xmlns:uc="clr-namespace:FYP" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Messenger_APP" Height="452.5" Width="1160" WindowState="Maximized" Icon="pic/messenger_icon.png" Loaded="Window_Loaded" Closing="Window_Closing"> <!-- ############################################# UI ELEMENT CONTROL ###################################################################--> <Grid HorizontalAlignment="Stretch"> <Grid.RowDefinitions> <RowDefinition Height="120"></RowDefinition> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <!-- top--> <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="500"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition> </Grid.ColumnDefinitions> <!--UC Button--> <uc:uc_CircularProgressButton x:Name="btnOne" Radius="30" Height="80" Width="200" ButtonName="EXIT" Grid.Column="2" FontSize="22" Margin="20" /> </Grid> </StackPanel> <!--bottom : webControl--> <WebBrowser x:Name="wbMessenger" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" LoadCompleted="wbMessenger_LoadCompleted" /> </Grid> </Window>
UserControl.xaml
<UserControl x:Name="userControl" x:Class="FYP.uc_CircularProgressButton" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:eyeX="clr-namespace:EyeXFramework.Wpf;assembly=EyeXFramework" mc:Ignorable="d" d:DesignHeight="200" d:DesignWidth="280"> <UserControl.Resources> <Style x:Key="EyeXGazeAwareElement" TargetType="FrameworkElement"> <Setter Property="eyeX:Behavior.GazeAware" Value="True" /> <!--<Setter Property="eyeX:Behavior.GazeAwareDelay" Value="250" />--> </Style> <Style x:Key="EyeXGazeAwareButton" BasedOn="{StaticResource EyeXGazeAwareElement}" TargetType="Button"> <Setter Property="Background" Value="LightSteelBlue" /> <Style.Triggers> <Trigger Property="eyeX:Behavior.HasGaze" Value="True"> <Setter Property="Background" Value="Red" /> </Trigger> </Style.Triggers> </Style> </UserControl.Resources> <Grid> <Button x:Name="btnButton" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="onButtonClick" MouseEnter="btnButton_MouseEnter" MouseLeave="btnButton_MouseLeave" Style="{StaticResource EyeXGazeAwareButton}"> <Path x:Name="pathRoot" Stroke="{Binding SegmentColor}" StrokeThickness="{Binding StrokeThickness}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigureCollection> <PathFigure x:Name="pathFigure"> <PathFigure.Segments> <PathSegmentCollection> <ArcSegment x:Name="arcSegment" SweepDirection="Clockwise" /> </PathSegmentCollection> </PathFigure.Segments> </PathFigure> </PathFigureCollection> </PathGeometry.Figures> </PathGeometry> </Path.Data> </Path> </Button> <TextBlock x:Name="lblButton" Text="{Binding ButtonName}" HorizontalAlignment="Center" FontWeight="Bold" VerticalAlignment="Center"></TextBlock> </Grid> </UserControl>
07/01/2016 at 21:29 #4040HanzParticipantHi, Is it because the On Aware element is an inner of a Element resulting intermittent sensing?
21/01/2016 at 15:23 #4163Eddie [Tobii]ParticipantHi Hanz,
I’m very sorry for the long delay in answering this issue. If I understand you correctly, you mean that sometimes when you start your application, the button is gaze-aware, and other times the button never react to gaze?
Which version of the Tobii Engine are you running?
I made a small application with the code you provided, and could unfortunately not reproduce what you describe. If you approve we could discuss your issue via email.
Kind regards,
Eddie24/01/2016 at 06:22 #4173HanzParticipantHi Eddie,
thank your reply. sure, may I know which email address should I direct?
Hanz
- AuthorPosts
- You must be logged in to reply to this topic.