Page.WindowWidth 屬性

定義

取得或設定 Window 之裝載 NavigationWindowPage 的寬度。

public:
 property double WindowWidth { double get(); void set(double value); };
public double WindowWidth { get; set; }
member this.WindowWidth : double with get, set
Public Property WindowWidth As Double

屬性值

Double

直接裝載 Page 之視窗的寬度。

範例

下列範例示範如何從頁面設定視窗的寬度。

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SetWindowWidthPage"
    WindowWidth="500"
    >
</Page>

備註

WindowWidth 只有在由視窗直接裝載 時 Page ,才會套用 ,包括:

Page如果 是由 Frame 裝載,則設定 WindowWidth 沒有作用,但您仍然可以取得 的值 WindowWidth

PageXAML 瀏覽器應用程式中的 (XBAP) 只能用來 WindowWidth 變更 internet Explorer Windows寬度;無法藉由設定 WidthMinWidthMaxWidth 來變更寬度。

Windows Internet Explorer 視窗的最小寬度為 250 圖元。 對於瀏覽器裝載的頁面,這表示 如果 會導致 Windows Internet Explorer 視窗的總寬度小於 250 圖元,則可能不會套用 的值 WindowWidth

適用於