Share via


Page.WindowWidth プロパティ

定義

Window のホスト NavigationWindow または Page の幅を取得または設定します。

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

プロパティ値

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値は引き続き取得できます。

Page XAML ブラウザー アプリケーション (XBAP) の では、 を使用WindowWidthしてブラウザーの幅を変更することしかできません。、、または MaxWidthを設定WidthMinWidthして幅を変更することはできません。

XBAP のサポートの詳細については、「 WPF ブラウザーでホストされるアプリケーション (XBAP) についてよく寄せられる質問」を参照してください。

Windows インターネット エクスプローラー ウィンドウの最小幅は 250 ピクセルです。 ブラウザーでホストされるページの場合、Windows インターネット エクスプローラー ウィンドウのWindowWidth合計幅が 250 ピクセル未満になる場合、 の値が適用されない可能性があることを意味します。

適用対象