windows phone應用開發嘗試


這個應用,其實也算不上應用,是自己第一次真正嘗試編寫的程序,全程用XAML編寫,由於之前學C#時過於急功近利,現在C#已經忘光了,廢話不多說,下面開始介紹;

UI如下:

這個應用其實就是通過HyperlinkButtonl控件來調取一些微軟常用應用的網頁版,主要控件是Grid、HyerlinkButton還有Flyout,因此,這個應用基本不具有任何實用性,唯一的作用就是練練手。這一應用,有一模塊為『尚未開發中....』,點擊Setting也會彈出如下信息,顯然應用並不完整

沒辦法,目前能力有限,只好如此。因為博主也是剛剛接觸到WP開發,幾乎什么都不會,深感windowsphone開發的教程稀缺。博主也經常在MSDN和博客園里找教程,自己摸索出來這一點東西,和大家分享交流,希望能共同進步。我微博賬號@馬and康,有興趣的朋友可以互粉,一起交流。

代碼如下:

XAML代碼;

<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid >
        <Grid.Background >
            <ImageBrush ImageSource="Assets\blackground1.jpg" AlignmentY="Bottom" AlignmentX="Left"/>
        </Grid.Background>
        <Grid Margin="0,150,0,200" >
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <HyperlinkButton Content="必應bing" Background="Red" Grid.Row="0" Margin="0,0,0,0" Width="190" Height="132" NavigateUri="http://cn.bing.com/"/>
            <HyperlinkButton Content="尚未開發中......" FontSize="25" Background="Red"  Grid.Row="1" Margin="0,0,0,0" Width="190" Height="132"/>
            <HyperlinkButton  Content="App store" Background="Red"  Grid.Column="1" Margin="0,0,0,0" Width="190" Height="132" NavigateUri="http://www.windowsphone.com/zh-cn/store"/>
            <Grid Grid.Row="1" Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions >
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <HyperlinkButton Content="onedrive" FontSize="20" Background="Blue"  Grid.Row="0" Margin="0,0,0,0" Width="95" Height="60" NavigateUri="https://skydrive.live.com/"/>
                <HyperlinkButton Content="Hotmail" FontSize="20" Background="Green"  Grid.Row="1" Height="60" Margin="0,0,0,0" Width="95" NavigateUri="http://www.hotmail.com "/>
                <HyperlinkButton Content="admin" FontSize="20" Background="Green"  Grid.Column="1" Height="60" Width="95" Margin="0,0,0,0" NavigateUri="http://login.live.com/"/>
                <Button Content="setting" FontSize="20"     Grid.Column="1" Background="Blue"   Grid.Row="1" Height="79" Width="27" Margin="0,-3.5,0,-3" BorderThickness="0">
                    <Button.Flyout >
                        <Flyout >
                            <StackPanel Margin="0,0,3,0" ManipulationMode="None" >
                                <TextBlock Text="此模塊正在開發中....." FontSize="18"/>
                                <TextBlock Text="This section is under construction....." FontSize="15"/>
                            </StackPanel>
                        </Flyout>
                    </Button.Flyout>
                </Button>
            </Grid>
        </Grid>
    </Grid>
</Page>

至於C#代碼就不提供了,因為這一應用沒用到C#代碼,

微博@馬and康


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM