zoukankan      html  css  js  c++  java
  • metro 拖动元素 元素 GIS

    public sealed partial class MainPage : Page
    {
    // Global Transform used to change the position of the Rectangle.
    private TranslateTransform dragTranslation;

    // Constructor
    public MainPage()
    {
    InitializeComponent();

    // Add handler for the ManipulationDelta event

    TestRectangle.ManipulationDelta += Drag_ManipulationDelta;

    dragTranslation = new TranslateTransform();
    TestRectangle.RenderTransform = this.dragTranslation;
    }

    void TestRectangle_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
    {

    }

    void Drag_ManipulationDelta(object sender,ManipulationDeltaRoutedEventArgs e)
    {
    // Move the rectangle.
    dragTranslation.X += e.Delta.Translation.X;
    dragTranslation.Y += e.Delta.Translation.Y;
    }

    }

    <Page
    x:Class="dragTranslationx.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:dragTranslationx"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <Grid.ChildrenTransitions>
    <TransitionCollection>
    <EntranceThemeTransition/>
    </TransitionCollection>
    </Grid.ChildrenTransitions>
    <Grid.Resources>
    <Storyboard x:Name="downAnimation">

    </Storyboard>
    <Storyboard x:Name="upAnimation">

    </Storyboard>
    </Grid.Resources>



    <Rectangle ManipulationMode="All" Width="200" Height="200" Fill="Beige" x:Name="TestRectangle" ></Rectangle>
    </Grid>

    </Page>

  • 相关阅读:
    [悟]你为什么想创业
    [悟] 因上努力,果上随缘
    自己写个多任务多线程断点下载框架
    大道甚夷,而人好径
    [经验帖]外包如何定价
    python 基础语法
    python 中文编码问题
    python的运行机制和版本区别
    [转]linux 调用动态库so文件
    shell join详解
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2690526.html
Copyright © 2011-2022 走看看