- 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.
- 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.
- 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"; } }}