Xaml Windows应用商店应用程序:转发鼠标事件
我有一个全屏Bing地图控件。在顶部,我想覆盖其他各种控件Xaml Windows应用商店应用程序:转发鼠标事件,xaml,events,windows-store-apps,ui-automation,bing-maps,Xaml,Events,Windows Store Apps,Ui Automation,Bing Maps,我有一个全屏Bing地图控件。在顶部,我想覆盖其他各种控件 <Grid> <maps:Map x:Name="Map" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> <Grid Style="{StaticResource LayoutRootStyle}" Background="Transparent" x:Name="InnerGrid"> <Grid.R
<Grid>
<maps:Map x:Name="Map" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Grid Style="{StaticResource LayoutRootStyle}" Background="Transparent"
x:Name="InnerGrid">
<Grid.RowDefinitions>
<RowDefinition Height="132" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="700" />
<ColumnDefinition Width="350" />
</Grid.ColumnDefinitions>
... Content ...
所以-我可以捕获事件,但我不知道如何在Map控件上触发事件。看了自动化同行的东西后,他们似乎关心的是比鼠标按下更高级别的概念,例如开放工具提示等
知道如何将所有事件从InnerGrid控件转发到Map控件吗
非常感谢您的帮助,
乔恩好的-我找到了一份工作。在InnerGrid上设置Background=“{x:Null}”使其转发事件。与MSDN上一样,未记录的内容非常精美:-) 如果有人知道更多的信息,我仍然想知道其他可用的方法 非常感谢,, 乔恩
internal sealed partial class PageCodeBehind : Page
{
public PageCodeBehind()
{
InitializeComponent();
InnerGrid.AddHandler(PointerPressedEvent, new PointerEventHandler(OnPointerPressedEvent), true);
InnerGrid.AddHandler(PointerMovedEvent, new PointerEventHandler(OnPointerMovedEvent), true);
}
private void OnPointerPressedEvent(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
{
// I can hit a breakpoint here...
var peer = FrameworkElementAutomationPeer.FromElement(GigMap) as MapAutomationPeer;
peer.RaiseAutomationEvent(...);