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>

  • 相关阅读:
    家庭记账本安卓版开发:第六天
    django-自定义过滤器
    django-标签语法
    django-url的分发, 2)起别名, 3)根目录,4)rediect跳转函数:
    django-MTV基础篇
    django-第一天
    jquery---响应式方面应用
    css-基础知识
    HTML--第一章的基本知识
    003
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2690526.html
Copyright © 2011-2022 走看看