Windows 8 Store Apps Learning (2) button control

Source: Internet
Author: User

Button, Hyperlinkbutton, RepeatButton

Introduced

Re-imagine the Windows 8 Store Apps Button control

button-Buttons Control

Hyperlinkbutton-Super Chain button

RepeatButton-Press the button to repeat the click action

ToggleButton-Toggle State button

RadioButton-Radio Box control

CheckBox-check box control

Toggleswitch-State Toggle Control

Example

1, Button's Demo

ButtonDemo.xaml.cs

/* button-pushbutton control * * using System;   
Using Windows.UI.Popups;   
Using Windows.UI.Xaml;   
Using Windows.UI.Xaml.Controls;   
       
Using Windows.UI.Xaml.Navigation; Namespace Xamldemo.controls {public sealed partial class Buttondemo:page {public Buttondem O () {this.   
        InitializeComponent (); } protected override void Onnavigatedto (NavigationEventArgs e) {/ * button-buttons control, all of which function is provided through its base class ButtonBase * Clickmode-the mode that raises the Click event: Clickmode.relea     SE (default), Clickmode.press, Clickmode.hover * ispointerover-device pointer (mouse or finger) on the button *
       
            IsPressed-whether the current button is in the pressed state * Command and CommandParameter etc when writing to MVVM and then write in detail * *   
            Button btn = New button (); Btn.   
            Content = "I am a button"; Btn.   
    Clickmode = Clickmode.hover;        Btn.   
            Click + + Btn_click; Root.   
        Children.add (BTN); } async void Btn_click (object sender, RoutedEventArgs e) {await New Messagedialog ("The Click event that triggered the button").   
        Showasync (); }   
    }   
}

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.