下面的示例演示如何只使用标记来定义一个标准页:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Markup Page">
<!-- Page Content Goes Here -->
</Page>
下面的示例演示如何只使用代码来定义一个标准页:
using System.Windows.Controls;
public class CodePage : Page
{
public CodePage() {}
}
下面的示例演示如何使用标记与代码隐藏的组合来定义一个标准页。
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MarkupAndCodeBehindPage"
Title="Markup And Code-Behind Page">
<!-- Page Content Goes Here -->
</Page>
using System.Windows.Controls;
public partial class MarkupAndCodeBehindPage : Page
{
public MarkupAndCodeBehindPage()
{
InitializeComponent();
}
}