请单击以进行评分并提供反馈
MSDN
MSDN Library
.NET 开发
.NET Framework
Page 类

  开启低带宽视图
此页面仅适用于
Microsoft Visual Studio 2008/.NET Framework 3.5

同时提供下列产品的其他版本:
.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();
    }
}

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

Windows Vista

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

.NET Framework

受以下版本支持:3.5、3.0
社区内容   什么是社区内容?
添加新内容 RSS  批注
Processing
© 2009 Microsoft Corporation 版权所有。 保留所有权利  |  商标  |  隐私权声明
Page view tracker