如题,解决方案,参考【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. java求两个集合的交集和并集,比较器

    求连个集合的交集: import java.util.ArrayList; import java.util.List; public class TestCollection { public st ...

  2. 真机测试报错ERROR/AndroidRuntime: java.lang.RuntimeException: setParameters failed解决办法

    这个错误是和调用相机摄像头相关的. 产生这个错误的原因主要在于代码控制分辨率的显示和真机测试分辨率不一样. 一:解决办法 WindowManager wm = (WindowManager) getS ...

  3. Luogu P1311 选择客栈

    暴力 我一开始做这道题先想到的就是暴力... 所以先说一下暴力的做法.首先在输入的时候讲花费小于P的位置标记下来,然后用两层循环枚举所有的两个客栈的组合方案.再用一层循环将两个客栈之间的位置扫一遍,如 ...

  4. Java中对象流使用的一个注意事项

    再写jsp的实验作业的时候,需要用到java中对象流,但是碰到了之前没有遇到过的情况,改bug改到崩溃!!记录下来供大家分享 如果要用对象流去读取一个文件,一定要先判断这个文件的内容是否为空,如果为空 ...

  5. Gym - 101670C Chessboard Dancing(CTU Open Contest 2017 找规律)

    题目:链接 思路: 多画出几个情况就可以找出规律来了 Knight (当大于2的时候只要两种颜色相间出现就可以了) King(当大于等于3的时候,总可以用四种形式来补色,具体如下)  Bishop(斜 ...

  6. [luogu4127 AHOI2009] 同类分布 (数位dp)

    传送门 Solution 裸数位dp,空间存不下只能枚举数字具体是什么 注意memset最好为-1,不要是0,有很多状态答案为0 Code //By Menteur_Hxy #include < ...

  7. Python学习-算术运算符,赋值运算符和复合运算符

    算术运算符 常见的算术运算符有 : +     加法运算符 print(1 + 2); // 3 print('1' + '2'); //12 不仅可以进行2个数字的相加,还可以连接2个字符串 -   ...

  8. dock helloworld

    Docker Hello World Docker 允许你在容器内运行应用程序, 使用 docker run 命令来在容器内运行一个应用程序. 输出Hello world runoob@runoob: ...

  9. Python随笔day03

    温故知新: 注释: 单行注释   # 多行注释   ‘’’ ‘’’  或者  “””  “”” 注意:三个单引号或双引号可以用于表示多行字符串. 判断输入的字符串是否是数字 salary = inpu ...

  10. np.tile(), np.repeat() 和 tf.tile()

    以上三个函数,主要区别在于能够拓展维度上和重复方式: np.tile() 能够拓展维度,并且整体重复: a = np.array([0,1,2]) np.tile(a,(2,2)) # out # a ...