Windows 8 Store Apps Learning (50) Input: Edge gestures, gesture manipulation, gesture recognition

Source: Internet
Author: User
Tags touch xmlns

Introduced

Re-imagine the Windows 8 Store Apps gesture

Monitoring Edge gestures

Gesture manipulation-Application of Manipulate (displacement gestures, scaling gestures, rotating gestures)

Gesture recognition-the application of Gesturerecognizer

Example

1. Demonstrate how to monitor edge gestures

Input/touch/edgegesturedemo.xaml

<page
    x:class= "XamlDemo.Input.Touch.EdgeGestureDemo"
    xmlns= "http://schemas.microsoft.com/winfx/2006 /xaml/presentation "
    xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
    xmlns:local=" using: XamlDemo.Input.Touch "
    xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 "
    xmlns:mc=" http:// schemas.openxmlformats.org/markup-compatibility/2006 "
    mc:ignorable=" D ">
    
    <grid background=" Transparent ">
        <stackpanel margin=" 0 0 0 ">
                
            <textblock name=" lblmsg "fontsize=" 14.667 "/>
                
        </StackPanel>
    </Grid>
</Page>

Input/touch/edgegesturedemo.xaml.cs

* * Demonstrates how to monitor edge gestures * * edgegesture-edge gesture Help class * Getforcurrentview ()-Get current Edgegesture object * Starting-edge gesture start     Event to Trigger * Completed-the event that is triggered after the edge gesture is completed * Canceled-event triggered after edge gesture cancellation * * Edgegestureeventargs-event parameters after triggering edge gesture events *
Edgegesturekind-Edge gesture input type (touch, keyboard, Mouse) * * using System;
Using Windows.UI.Input;
    
Using Windows.UI.Xaml.Controls; Namespace XamlDemo.Input.Touch {public sealed partial class Edgegesturedemo:page {public Edgegesturede Mo () {this.
    
            InitializeComponent ();
    
            Edgegesture edgegesture = Edgegesture.getforcurrentview ();
            edgegesture.canceled + = edgegesture_canceled;
            edgegesture.completed + = edgegesture_completed;
        Edgegesture.starting + = edgegesture_starting; } void Edgegesture_starting (edgegesture sender, Edgegestureeventargs args) {Lblmsg.text
            + = "Edgegesture starting"; Lblmsg.text += Environment.NewLine;  } void Edgegesture_completed (edgegesture sender, Edgegestureeventargs args) {Lblmsg.text
            + = "Edgegesture Completed";
        Lblmsg.text + = Environment.NewLine; } void Edgegesture_canceled (edgegesture sender, Edgegestureeventargs args) {Lblmsg.text
            + = "Edgegesture Canceled";
        Lblmsg.text + = Environment.NewLine; }
    }
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.