Home Forums Software Development Creating call back functions for interactors Reply To: Creating call back functions for interactors

#7861
Anonymous
Inactive

I couldn’t quite get the idea of unique ID. As i have to create a keypad (0-9) and want to know at which key user is looking at. Using the panel shown in example code I tried to create 4 panels and put them in a grid. Each panel is assigned with a different handler as shown below : –

`<Style x:Key=”EyeXGazeAwarePanel1″ BasedOn=”{StaticResource EyeXGazeAwareElement}” TargetType=”Panel”>
<Setter Property=”Background” Value=”Red” />
<EventSetter Event=”eyeX:Behavior.HasGazeChanged” Handler=”Instruction_OnHasGazeEnter1″ />
<Style.Triggers>
<Trigger Property=”eyeX:Behavior.HasGaze” Value=”True”>
<Setter Property=”Background” Value=”DarkMagenta” />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key=”EyeXGazeAwarePanel2″ BasedOn=”{StaticResource EyeXGazeAwareElement}” TargetType=”Panel”>
<Setter Property=”Background” Value=”DarkBlue” />
<EventSetter Event=”eyeX:Behavior.HasGazeChanged” Handler=”Instruction_OnHasGazeEnter2″ />
<Style.Triggers>
<Trigger Property=”eyeX:Behavior.HasGaze” Value=”True”>
<Setter Property=”Background” Value=”DarkMagenta” />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key=”EyeXGazeAwarePanel3″ BasedOn=”{StaticResource EyeXGazeAwareElement}” TargetType=”Panel”>
<Setter Property=”Background” Value=”Red” />
<EventSetter Event=”eyeX:Behavior.HasGazeChanged” Handler=”Instruction_OnHasGazeEnter3″ />
<Style.Triggers>
<Trigger Property=”eyeX:Behavior.HasGaze” Value=”True”>
<Setter Property=”Background” Value=”DarkMagenta” />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key=”EyeXGazeAwarePanel4″ BasedOn=”{StaticResource EyeXGazeAwareElement}” TargetType=”Panel”>
<Setter Property=”Background” Value=”DarkBlue” />
<EventSetter Event=”eyeX:Behavior.HasGazeChanged” Handler=”Instruction_OnHasGazeEnter4″ />
<Style.Triggers>
<Trigger Property=”eyeX:Behavior.HasGaze” Value=”True”>
<Setter Property=”Background” Value=”DarkMagenta” />
</Trigger>
</Style.Triggers>
</Style>

</ResourceDictionary>
</Window.Resources>

<UniformGrid Rows=”4″ Columns=”3″>
<DockPanel Style=”{StaticResource EyeXGazeAwarePanel1}” Margin=”25″/>
<DockPanel Style=”{StaticResource EyeXGazeAwarePanel2}” Margin=”25″/>
<DockPanel Style=”{StaticResource EyeXGazeAwarePanel3}” Margin=”25″/>
<DockPanel Style=”{StaticResource EyeXGazeAwarePanel4}” Margin=”25″/>
</UniformGrid>

Is it possible to create a single panel and when I am putting it in form of grid I can attach a unique ID to it.Which mean it calls back only on function but depending on which panel the user looks it send back the function(Instruction_OnHasGazeEnter) a different number. Once the user look at one panel for one sec I want t call the handler and save the key number of panel which the user selected Because from the example code this is the only way i think of it.