Windows PHONE Development-Getting Started program building

Source: Internet
Author: User

1: The page has the extension:. xaml files like ASPX can write client display content and background processing content

The general front page is in the form of:

<Pagex:class= "Myfirstapp.mainpage"xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local= "Using:myfirstapp"xmlns:d= "http://schemas.microsoft.com/expression/blend/2008"XMLNS:MC= "http://schemas.openxmlformats.org/markup-compatibility/2006"mc:ignorable= "D"
<!-- reference namespaces -Xmlns:tabctl= "Using:customcontrol"
<!-- call the background pagesizechanged method --SizeChanged= "Pagesizechanged"
<!-- Settings page background color is white -- Background= "White"> <!--above toolbar - <Page.topappbar> <AppBarx:name= "Topbar"Issticky= "True"Style="{StaticResource Topbar}"Closed= "modetoolbar_closed"opened= "topbar_opened" > <Gridx:name= "Menugrid"VerticalAlignment= "Center"> <grid.columndefinitions> <ColumnDefinitionWidth= "+"/> <ColumnDefinitionMinWidth= "615"Width="*" /> <ColumnDefinitionWidth= "105> </Grid.ColumnDefinitions> <appbarbutton x:name="tooltest1 "Label= "Test1"Click= "btnTest_Click"></Appbarbutton> <Appbarbuttonx:name= "Tooltest2"Grid.column= "2"Label= "Test2"isenabled= "False"></Appbarbutton> </Grid> </AppBar> </Page.topappbar> <!--The following toolbar - <Page.bottomappbar> <AppBarx:name= "Modetoolbar"Issticky= "True"Style="{StaticResource Bottomappbar}" > <Gridx:name= "EditGrid"VerticalAlignment= "Center"> <grid.columndefinitions> <ColumnDefinitionWidth= "+" /> <ColumnDefinitionWidth= "The " /> </grid.columndefinitions> <Appbarbuttonx:name= "Tooltest3"Grid.column= "1"HorizontalAlignment= "Center"Label= "Test3" ></Appbarbutton> <Appbarbuttonx:name= "Tooltest4"Grid.column= "2"HorizontalAlignment= "Center"Label= "Test4" ></Appbarbutton> </Grid> </AppBar> </Page.bottomappbar></Page>

2: General steps for using StaticResource reference styles
Create the Styles folder and create the Styles.xaml file in the folder

Delete Styles.xaml.cs file

Open the Styles.xaml file and write the style code as follows

<ResourceDictionaryxmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local= "Using:myfirstappstyles">
<Stylex:key= "Topbar"TargetType= "AppBar"> <Setter Property= "Height"Value= "$"/> <Setter Property= "Background"Value= "#CC222846"/> </Style>
</ResourceDictionary>

Configuring Association files in App.xaml

<Applicationx:class= "Myfirstapp.app"xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local= "Using:myfirstapp">        <!--Associating resources Files -    <application.resources>        <ResourceDictionary>            <resourcedictionary.mergeddictionaries>                <ResourceDictionarySource= "Styles/styles.xaml" />            </resourcedictionary.mergeddictionaries>        </ResourceDictionary>    </application.resources>    </Application>


Windows PHONE Development-Getting Started program building

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.