[In layman's Windows 10] split-screen control (SplitView)

Source: Internet
Author: User

4.18 split screen control (SplitView)

The Split-screen control (SplitView) is a new type of control for Windows 10 and an interactive control for the Windows 10 general application push, often paired with a burger button as a drawer menu. The XAML syntax for the control is as follows:

<SplitView>

<splitview.pane >

...... Contents of the menu panel

</splitview.pane >

...... Main content

</SplitView>

The Splitview control consists mainly of two parts: a menu panel, the other part is the main content, the menu panel is assigned by the pane property, and the Ispaneopen property controls the open and closed state, True indicates open, False indicates off. When the menu is closed, the page will all show the main content of the Splitview, the content property of the theme, concise XAML syntax can be directly written in the Splitview node.

The following is an example of the Splitview control: Implementing the Burger menu.

Code Listing 4-18 : Splitview Control (Source code: 4th Chapter \EXAMPLES_4_18)

MainPage.xaml file Main code-------------------------------------------------------------------------------------------------- ----------------    <GridBackground="{ThemeResource Applicationpagebackgroundthemebrush}">        <ToggleButtonClick= "Button_Click"VerticalAlignment= "Top"Foreground= "Green" >            <togglebutton.content>                <BorderBackground= "Transparent"Width= "Max"Height= "Max">                    <Fonticonx:name= "Hamburger"FontFamily= "Segoe MDL2 Assets"Glyph= "& #xE700;" />                </Border>            </togglebutton.content>        </ToggleButton>        <SplitViewx:name= "Splitter"Ispaneopen= "True" >            <Splitview.pane>                <StackPanelVerticalAlignment= "Center">                    <ButtonContent= "Menu 1"Click= "Button_click_1"></Button>                    <ButtonContent= "Menu 2"Click= "Button_click_1"></Button>                    <ButtonContent= "Menu 3"Click= "Button_click_1"></Button>                    <ButtonContent= "Menu 4"Click= "Button_click_1"></Button>                </StackPanel>            </Splitview.pane>            <Grid>                <TextBlockx:name= "TB"Text=""VerticalAlignment= "Center"HorizontalAlignment= "Center"></TextBlock>            </Grid>        </SplitView>    </Grid>
MainPage.xaml.cs file Main code--------------------------------------------------------------------------------------------------------------- ---//Burger icon Button event handling    Private voidButton_Click (Objectsender, RoutedEventArgs e) {Splitter.ispaneopen= (Splitter.ispaneopen = =true) ?false:true; }    //button Event handling in burger menu    Private voidButton_click_1 (Objectsender, RoutedEventArgs e) {Splitter.ispaneopen=false; Tb. Text="Hello"+ (Sender asButton).    Content.tostring (); }

This article is from the general application development of Windows 10 in layman's

Source code Download: http://vdisk.weibo.com/u/2186322691

Catalog: http://www.cnblogs.com/linzheng/p/5021428.html

Welcome to follow my Weibo @wp forestry Administration public Number: WP Development (No.: WPKAIFA)

WINDOWS10/WP Technology Group: 284783431

[In layman's Windows 10] split-screen control (SplitView)

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.