共用方式為


ListViewItemPresenter.PressedBackground 屬性

定義

ListView中,取得或設定筆刷,用來在使用者按下時呈現未選取專案的背景。 在 GridView中,會設定專案的框線,而不是背景。

public:
 property Brush ^ PressedBackground { Brush ^ get(); void set(Brush ^ value); };
Brush PressedBackground();

void PressedBackground(Brush value);
public Brush PressedBackground { get; set; }
var brush = listViewItemPresenter.pressedBackground;
listViewItemPresenter.pressedBackground = brush;
Public Property PressedBackground As Brush
<ListViewItemPresenter PressedBackground="themeResourceReference"/>

屬性值

筆刷,用來在按下時呈現未選取專案的背景 (ListView) 或框線 (GridView) 。

備註

XAML 語法注意事項

顯示的 XAML 使用方式是參考主題資源。 這是簡報者的 Brush 值通常會定義的方式,如此一來,主題變更時就可以變更值,而且可能讓 Brush 值可以由不同的範本共用。 使用直接參考 Brush 值的 XAML 語法可能但較不常見。 如需 Brush的直接 XAML 使用方式範例,請參閱 Brush 類別主題中的 XAML 一節。

如果您要將此屬性設定為自訂 ListViewItemPresenter上的屬性,請在顯示的 XAML 使用方式中取代自訂類別的前置名稱。

適用於

另請參閱