windows - Pinch Zoom Becomes Pan Gesture on MapControl -
i developing windows 10 uwp app. app has mapcontrol:
<maps:mapcontrol x:name="map" />
i add multiple instances of usercontrol xaml control usermapicon.xaml
:
<usercontrol x:class="taq.views.usermapicon" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:taq.views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" d:designheight="20" d:designwidth="20"> <grid> <ellipse width="10" height="10" fill="black"></ellipse> </grid> </usercontrol>
to map c# code:
// ... var umi = new usermapicon(); map.children.add(umi); // ...
several times purposes. so, can imagine there map many circles in it.
the problem that: app runs on touch screen tablet, want zoom map 2 finger pinch. however, if 1 of finger touches usercontrol , finger touches map, pinch-zoom becomes pan gesture. how solve problem?
by experiment, setting usercontrol's ishittestvisible="false" solves problem.
<usercontrol x:class="taq.views.usermapicon" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:taq.views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" d:designheight="20" d:designwidth="20" ishittestvisible="false"> <grid> <ellipse width="10" height="10" fill="black"></ellipse> </grid> </usercontrol>
Comments
Post a Comment