Use Windows 8 to develop Metro style Application 1

Source: Internet
Author: User
  1. Metro-style applications are designed in full screen mode. They are beautiful and vivid. They can be associated with people and content you are interested in. They are highly interactive and touch-based. They can also be used in various la S and specifications. Metro applications use a central stage, while the operating system keeps running in the background.
  2. When creating a Metro style application, you can use the following three methods:
    A) HTML5, stacked style sheets, level 3 (css3), and javascript can be used for development.
    B) You can use XAML to hide and develop Metro-style applications with the help of code in C ++, C #, or Microsoft Visual Basic.
    C) You can use the local C ++ and HLSL to develop the metro DirectX game, so as to fully utilize the advantages of the graphic hardware.
  3. Create the first metro style application, hello World
    A) when using C # Or Visual Basic to create a metro-style application, you usually use XAML to define the UI and write the application logic in the associated code hidden file in the selected language. The xaml ui framework of a metro-style application written in C # Or Visual Basic is located in the windows. UI. XAML. * namespace during windows runtime. If you have written applications using Windows Presentation Foundation (WPF), Silverlight or Silverlight for Windows Phone, you should be familiar with this programming model, you can also use C ++, C #, or visual basic to create your Metro-style applications.
    B) The example here shows the XAML that defines the UI of a simple hello World application and its associated code hidden page. Even this simple example shows several very important concepts for a XAML-based programming model, including partial classification, layout, controls, attributes, and events. The example here shows the XAML that defines the UI of a simple hello World application and its associated code hidden page. Even this simple example shows several very important concepts for a XAML-based programming model, including partial classification, layout, controls, attributes, and events.
<Page    x:Class="HelloWorld.BlankPage"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:local="using:HelloWorld"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    mc:Ignorable="d">    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">        <StackPanel>            <Button Content="Click Me" Click="HelloButton_Click" />            <TextBlock x:Name="DisplayText" FontSize="48" />        </StackPanel>    </Grid></Page>

 

View code

using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;using Windows.UI.Xaml.Navigation;namespace HelloWorld{    public sealed partial class BlankPage : Page    {        public BlankPage()        {            InitializeComponent();        }        private void HelloButton_Click(object sender, RoutedEventArgs e)        {            DisplayText.Text = "Hello World";        }    }}

 

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.