如题,解决方案,参考【Windows phone应用开发[20]-禁止Pivot手势】http://www.cnblogs.com/chenkai/p/3408658.html

xaml代码清单

 

<phone:PhoneApplicationPage

    x:Class="PhoneApp2.Samples.MapPage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    FontFamily="{StaticResource PhoneFontFamilyNormal}"

    FontSize="{StaticResource PhoneFontSizeNormal}"

    Foreground="{StaticResource PhoneForegroundBrush}"

    SupportedOrientations="Portrait" Orientation="Portrait"

    mc:Ignorable="d"

    shell:SystemTray.IsVisible="True">

 

    <!--LayoutRoot 是包含所有页面内容的根网格-->

    <Grid x:Name="LayoutRoot" Background="Transparent">

        <Grid.RowDefinitions>

            <RowDefinition Height="Auto"/>

            <RowDefinition Height="*"/>

        </Grid.RowDefinitions>

 

        <!--TitlePanel 包含应用程序的名称和页标题-->

        <StackPanel Grid.Row="0" Margin="12,17,0,28">

            <TextBlock Text="我的应用程序" Style="{StaticResource PhoneTextNormalStyle}"/>

            <TextBlock Text="页面名称" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>

        </StackPanel>

 

        <!--ContentPanel - 在此处放置其他内容-->

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

            <phone:Pivot x:Name="pivot1" Grid.Row="1" Title="pivot" >

                <phone:PivotItem x:Name="pivot" CacheMode="{x:Null}" Header="item1" >

                    <Grid x:Name="mapLayer">

                    </Grid>

                </phone:PivotItem>

                <phone:PivotItem CacheMode="{x:Null}" Header="item2">

                    <Grid x:Name="mapLayer2">

                        <Button  Content="button" Margin="116,232,108,132"/>

                        <TextBlock Text="item2" Margin="150,174,124,244"/>

                    </Grid>

                </phone:PivotItem>

                <phone:PivotItem CacheMode="{x:Null}" Header="item2">

                    <Grid x:Name="mapLayer3">

                        <Button  Content="button" Margin="116,232,152,132"/>

                    <TextBlock Text="item2" Margin="150,174,124,244"/>

                     

                    </Grid>

                </phone:PivotItem>

            </phone:Pivot>

        </Grid>

    </Grid>

 

</phone:PhoneApplicationPage>

 

cs代码清单

 AMap amap;
AMapMarker marker; //private Point currentPoint;
//private Point oldPoint; public MapPage()
{
InitializeComponent(); this.mapLayer.Children.Add(amap = new AMap());
Touch.FrameReported += (s, e) =>
{
if (e.GetPrimaryTouchPoint(amap).Action == TouchAction.Up)
{
//this.pivot1.IsLocked = false;
}
};
//amap.ManipulationStarted += (s, e) =>
// {
// this.pivot1.IsLocked = true;
// }; //amap.Loaded += amap_Loaded;
this.Loaded += MapPage_Loaded;
} void MapPage_Loaded(object sender, RoutedEventArgs e)
{
Events();
} private void Events()
{
this.pivot.UseOptimizedManipulationRouting = false;
this.pivot.AddHandler(PivotItem.ManipulationStartedEvent, new EventHandler<ManipulationStartedEventArgs>(pivot_ManipulationStarted), true);
this.pivot.AddHandler(PivotItem.ManipulationDeltaEvent, new EventHandler<ManipulationDeltaEventArgs>(pivot_ManipulationCompleted), true);
} Point startPoint;
private void pivot_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
{
startPoint = e.ManipulationOrigin;
} private void pivot_ManipulationCompleted(object sender, ManipulationDeltaEventArgs e)
{
Point endPoint = e.ManipulationOrigin;
if (endPoint.X - startPoint.X >= 0)
{
#region Control Right Side
e.Complete();
e.Handled = true;
#endregion
}
if (endPoint.X - startPoint.X < 0)
{
#region Control Left Side
e.Complete();
e.Handled = true;
#endregion
}
}
}
 
 

【高德地图API】Pivot控件中加载地图并禁止Pivot手势的更多相关文章

  1. GridView控件中加自动排列序号

    GridView控件中加自动排列序号 为 Gridview 增加一个新的空白列,如下: <asp:BoundField  HeaderText="序号">    < ...

  2. 重新想象 Windows 8.1 Store Apps (81) - 控件增强: 加载本地 html, 智能替换 html 中的 url 引用, 通过 Share Contract 分享 WebView 中的内容, 为 WebView 截图

    原文:重新想象 Windows 8.1 Store Apps (81) - 控件增强: 加载本地 html, 智能替换 html 中的 url 引用, 通过 Share Contract 分享 Web ...

  3. easyui控件的加载顺序

    使用easyui做布局时,会模仿窗口程序界面,做出一些较复杂的布局.按由外层到内层的顺序: (最外层)panel->tabs->tabs1 ->tabs2->layout-&g ...

  4. 使用DevExpress.XtraTabbedMdi.XtraTabbedMdiManager控件来加载MDI窗体

    使用DevExpress.XtraTabbedMdi.XtraTabbedMdiManager控件来加载MDI窗体     [csharp] view plaincopyprint? <SPAN ...

  5. Delphi7 第三方控件1stClass4000的TfcImageBtn按钮控件动态加载jpg图片例子

    Delphi7 第三方控件1stClass4000的TfcImageBtn按钮控件动态加载jpg图片例子 procedure TForm1.Button1Click(Sender: TObject); ...

  6. 在WinForm应用程序中,使用选项卡控件来加载不同的Form界面!

    TabPage tp=new TabPage(); your选项卡控件.Controls.Add(tp); From1 frm=new Form1(); frm.TopLevel = false; f ...

  7. asp.net 在repeater控件中加按钮

    在repeater中加入方法有两种方法: 第一种:是对repeater控件的行添加OnItemCommand事件,添加方法也是有两种 1.在设计页面中,选中repeater控件右击==>属性== ...

  8. WPF 修改屏幕DPI,会触发控件重新加载Unload/Load

    修改屏幕DPI,会触发控件的Unloaded/Loaded 现象/重现案例 对Unloaded/Loaded的印象: FrameworkElement, 第一次加载显示时,会触发Loaded.元素被释 ...

  9. arcgis api for javascript本地部署加载地图

    最近开始学习arcgis api for javascript,发现一头雾水,决定记录下自己的学习过程. 一.下载arcgis api for js 4.2的library和jdk,具体安装包可以去官 ...

随机推荐

  1. xmpp登录(2)

    XMPP中常用对象们: XMPPStream:xmpp基础服务类 XMPPRoster:好友列表类 XMPPRosterCoreDataStorage:好友列表(用户账号)在core data中的操作 ...

  2. 扒一扒PROMISE的原理,大家不要怕!

    在前端的日常工作中,回调函数(callback)应该是见怪不怪了,但是当回调函数遇上了异步(async),这就令人发指了.那么异步是什么意思呢,简单地说就是不等你执行完,就先执行下方的代码了. 举个

  3. git 的 基础操作及使用

    /* git svn版本控制器 */ /*git把文件对应的储存空间分为三个区: 1.工作区 2.缓存区 3.历史区 直接操作文件,不做add时,咱们是在工作区做的修改 右键 git bash her ...

  4. [angular1.6]Error: "transition superseded" ui-router 在angular1.6 报错误问题解决

    在angular1.6版本里,使用ui-router如果报这个错误,可以将ui-router升级到最近版本即可.ui-router version v0.4.2

  5. lastpass密码管理工具使用教程

    现在移动互联网发展异常空气,无论访问哪个平台或者网站必须要注册账号,日子久了就会发现最痛苦的就是记住这些网站的密码.因为我们不可能将所有的网站都是设置同样的的账号密码,因为国内网站用户数据库被泄露的事 ...

  6. shell输出颜色、printf输出颜色

    1.echo开启彩色输出: -e 开启echo中的转义: \e或者\033来输出Esc颜色: 恢复默认颜色为:\e[0m; 命令格式: echo -e "\e[字背景颜色:文字颜色m字符串\ ...

  7. 阿里云服务器Ubuntu 16.04 3安装mysql

    .更新系统 apt-get update [注意:要在root用户下] .安装mysql-server apt-get install mysql-serverapt-get install mysq ...

  8. hdu 3062 2-sat

    #include<stdio.h> #include<string.h> #define N 2100 struct node { int u,v,next; }bian[N* ...

  9. $scope的生命周期

    model mutation 模型改变 model observation 模型观察 scope destruction scope结束 神奇的scope,一个angular应用只有一个scope,一 ...

  10. 安装Ubuntu 16.04时出现:没有定义根文件系统,请到分区菜单修改

    在安装Ubuntu 16.04时,尤其是选项空闲硬盘新建分区安装时,容易出现这种情况,这个是由于没有配置挂载点导致的,解决方法如下: 在挂在点输入“/”. 原理: Linux和Windows的文件系统 ...