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)