标签:
步骤 1:在 Visual Studio 中创建新项目
第 2 步:修改起始页文件中包含哪些内容?
App.xaml 和 App.xaml.cs
MainPage.xaml
[url=]XAML[/url]
<Page x:Class="HelloWorld.MainPage" 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="{ThemeResource ApplicationPageBackgroundThemeBrush}"> </Grid></Page>
[url=]C#[/url]
using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;namespace HelloWorld{ /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); } }}
修改起始页
[url=]XAML[/url]
<StackPanel x:Name="contentPanel" Margin="120,30,0,0"> <TextBlock Text="Hello, world!" Margin="0,0,0,40"/> <TextBlock Text="What‘s your name?"/> <StackPanel x:Name="inputPanel" Orientation="Horizontal" Margin="0,20,0,20"> <TextBox x:Name="nameInput" Width="270" HorizontalAlignment="Left"/> <Button x:Name="inputButton" Content="Say "Hello""/> </StackPanel> <TextBlock x:Name="greetingOutput"/> </StackPanel>
步骤 3:启动应用
标签:
原文地址:http://www.cnblogs.com/z1174299705/p/4918677.html