I'm developing Microsoft Surface(pixelsense) App using TagVisualizer object I'm looking for a method to capture tagEnter, tagLeave event on other UI elements such as a button. For example in following XAML code I want to capture an event when TagVisualizer enters the boundary of "Button1".
<Grid>
<s:TagVisualizer
Name="MaintagVisualizer" VisualizationAdded="MaintagVisualizer_VisualizationAdded"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Height="Auto" Width="Auto"
VerticalContentAlignment="Center" >
<s:TagVisualizer.Definitions>
<s:TagVisualizationDefinition LostTagTimeout="2000" MaxCount="1" Value="0x1" Source="TagVisualizationEllipse.xaml" />
</s:TagVisualizer.Definitions>
<s:SurfaceButton Name="Button1" HorizontalAlignment="Left" VerticalAlignment="Top" Content="test" Width="120" Height="40" Margin="20" ></s:SurfaceButton>
</s:TagVisualizer>
</Grid>
I know this is an old post, but I thought I would put something on the record to help others.
I'm working on something similar...trying to capture the touch events (down, up, etc) for when a tag is placed over the control called myMap.
Here is the solution I developed: first, a touch listener for the window:
Then the handler:
You could probably do the same thing with a button control. At the least this can get you started.