Different Windows Phone (1) Hello windows Phone

Source: Internet
Author: User
Tags xmlns silverlight


Introduced



Distinctive Windows Phone 7.5 (SDK 7.1)



Developing a Windows Phone application with Silverlight



Using XNA to develop a Windows Phone application



Developing Windows Phone applications with Silverlight and XNA combinations (incorporating XNA in Silverlight)



Example



1. Use Silverlight to develop Windows Phone App Demo



MainPage.xaml


<phone:PhoneApplicationPage  
    x:Class="Silverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"> 
   
    <StackPanel> 
        <!--按钮--> 
        <Button Name="btn" Content="hello webabcd" /> 
    </StackPanel> 
    
</phone:PhoneApplicationPage>


MainPage.xaml.cs


Using System; 
Using System.Collections.Generic; 
Using System.Linq; 
Using System.Net; 
Using System.Windows; 
Using System.Windows.Controls; 
Using System.Windows.Documents; 
Using System.Windows.Input; 
Using System.Windows.Media; 
Using System.Windows.Media.Animation; 
Using System.Windows.Shapes; 
Using Microsoft.Phone.Controls; 
   
Namespace Silverlight 
{public 
    partial class Mainpage:phoneapplicationpage 
    {public 
        MainPage () c17/>{ 
            InitializeComponent (); 
   
            This. Loaded + + new Routedeventhandler (mainpage_loaded); 
        } 
   
        void Mainpage_loaded (object sender, RoutedEventArgs e) 
        { 
            //pop-up MessageBox information 
            btn. Click + = delegate {MessageBox.Show ("Hello Webabcd");} 




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.