System.Windows.Controls 命名空 ...


.NET Framework 类库
Page 类

更新:2007 年 11 月

封装一页可由 Windows Internet Explorer、NavigationWindowFrame 导航到和承载的内容。

命名空间:  System.Windows.Controls
程序集:  PresentationFramework(在 PresentationFramework.dll 中)
用于 XAML 的 XMLNS:http://schemas.microsoft.com/winfx/xaml/presentation

语法

Visual Basic(声明)
<ContentPropertyAttribute("Content")> _
Public Class Page _
    Inherits FrameworkElement _
    Implements IAddChild
Visual Basic (用法)
Dim instance As Page
C#
[ContentPropertyAttribute("Content")]
public class Page : FrameworkElement, IAddChild
Visual C++
[ContentPropertyAttribute(L"Content")]
public ref class Page : public FrameworkElement, 
    IAddChild
J#
/** @attribute ContentPropertyAttribute("Content") */
public class Page extends FrameworkElement implements IAddChild
JScript
public class Page extends FrameworkElement implements IAddChild
XAML 对象元素用法
<Page>
  Content
</Page>
备注

Page 封装一页可导航的内容,并具有以下关键成员:

可以使用标记、标记和代码隐藏或者代码来定义页。页通常是为导航而打包内容的首选方式,原因如下:

页可以通过 WindowNavigationWindowFrameUserControl 或浏览器来承载。要进行承载,页可以:

一个应用程序通常具有两个或更多页,可以使用以下机制在这些页之间导航:

有关使用页函数 (PageFunction<(Of <(T>)>)) 的结构化导航,请参见结构化导航概述导航拓扑概述

示例

下面的示例演示如何只使用标记来定义一个标准页:

C#
<Page 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    Title="Markup Page">
  <!-- Page Content Goes Here -->
</Page>

下面的示例演示如何只使用代码来定义一个标准页:

C#
using System.Windows.Controls;

public class CodePage : Page
{
    public CodePage() {}
}

下面的示例演示如何使用标记与代码隐藏的组合来定义一个标准页。

C#
<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>
C#
using System.Windows.Controls;

public partial class MarkupAndCodeBehindPage : Page
{
    public MarkupAndCodeBehindPage()
    {
        InitializeComponent();
    }
}
继承层次结构

System..::.Object
  System.Windows.Threading..::.DispatcherObject
    System.Windows..::.DependencyObject
      System.Windows.Media..::.Visual
        System.Windows..::.UIElement
          System.Windows..::.FrameworkElement
            System.Windows.Controls..::.Page
              System.Windows.Navigation..::.PageFunctionBase
线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。
平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.5、3.0
另请参见

参考

其他资源

标记 :


Page view tracker