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>

  • 相关阅读:
    POJ 3977 折半枚举
    [CQOI2007]余数求和 (分块+数学
    NOI P1896 互不侵犯 状压DP
    HDU 5446 Unknown Treasure (卢卡斯+CRT
    宁夏邀请赛F FLOYD
    P1414 又是毕业季II (数学?
    P2051 [AHOI2009]中国象棋 DP
    POJ 2449:Remmarguts' Date(A* + SPFA)
    HDU 6215:Brute Force Sorting(链表+队列)
    HDU 6207:Apple(Java高精度)
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2690526.html
Copyright © 2011-2022 走看看