Getting Started with Windows 8 Development (eight) slider controls and Toggleswitch controls in Windows 8

Source: Internet
Author: User

One: The Silder control is a slider control, also exists in Silverlight, it is mainly used for volume control, brightness adjustment, color adjustment, thermometer and so on.

Main properties:

FlowDirection: Slide from left to right or from right to left

Minimum: Minimum value

Maximum: Max value

Orientation: Arrangement direction, vertical arrangement or horizontal arrangement

Tickfrequency: The value between each tick is allowed under the condition of slider length

Tickplacement: Scale display position, above or below slider or inside slider

Primary event: valuechanged: Triggering this event when a value changes

XAML and CS Code:

<textblock horizontalalignment= "left" margin= "471,127,0,0" name= "Tbtext" textwrapping= "Wrap" Text= ""
           Verticalalignment= "Top" height= "width="/> <slider horizontalalignment= "left   
" value= "ten"  Name = "Slider1" flowdirection= "LeftToRight"
        minimum= "0" maximum= "M" orientation= "Vertical"
        tickfrequency= "5" Tickplacement= "BottomRight"
        margin= "701,127,0,0" verticalalignment= "Top" height= "" width= ""/> 

Public MainPage ()   
        {this   
            . InitializeComponent ();   
            This.slider1.ValueChanged + + slider1_valuechanged;   
        }   
       
        The new value of the void Slider1_valuechanged (object sender, Rangebasevaluechangedeventargs e)   
        {   
            this.tbText.Text = "Slider control : "+ e.newvalue +"  old value: "+ E.oldvalue;   
        }

Two: The Toggleswitch control is a switch control, the WiFi switch in Windows 8 is also implemented using this control, and can also be used as volume switch.

Main properties:

Offcontent: Names that need to be operated when the state is closed, such as open, open, enable

Oncontent: Names that need to be manipulated when the state is turned on, such as closing, close, disabling

Header: The name displayed by the head of the control.

Primary event: toggled: Triggers the processing event when the state is switched.

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.