GridSplitter.ShowsPreview 屬性

定義

取得或設定值,這個值表示 GridSplitter 控制項是否會隨著使用者拖曳控制項,更新資料行或資料列的大小。

public:
 property bool ShowsPreview { bool get(); void set(bool value); };
public bool ShowsPreview { get; set; }
member this.ShowsPreview : bool with get, set
Public Property ShowsPreview As Boolean

屬性值

Boolean

如果顯示 GridSplitter 預覽,則為 true,否則為 false。 預設為 false

範例

下列範例會示範如何設定 ShowsPreview 屬性。

myGridSplitter.ShowsPreview = true;
myGridSplitter.ShowsPreview = True
<GridSplitter ShowsPreview="True" Width="5"
              Grid.Column="4" Grid.RowSpan="2"/>

備註

GridSplitter需要 AdornerDecorator 物件出現在其父樹狀結構中,才能顯示拖曳預覽意見反應。 此需求通常是由 AdornerDecorator 物件在 物件所建立 ScrollViewer 之 或 物件的預設樣式 WindowAdornerDecorator 提供的物件所符合。 不過,如果兩者都無法使用, GridSplitter 控制項必須定義自己的 AdornerDecorator 物件。

相依性屬性資訊

識別碼欄位 ShowsPreviewProperty
中繼資料屬性設定為 true

ShowsPreview當 屬性設定為 true 時,會顯示資料列或資料行大小的變更預覽。 釋放 時 GridSplitter 的實際大小會變更。 如果 屬性設定 false 為 ,當使用者拖曳 GridSplitter 控制項時,資料行或資料列大小會即時更新。

如果使用鍵盤移動 GridSplitter 控制項,即使 屬性設定 true 為 ,資料 ShowsPreview 行或資料列大小仍會即時更新。

適用於