我需要覆蓋ListViewItem的預定義樣式,使其沒有可見的選擇。我知道如何將整個樣式複製到我的資源中並進行編輯。但我不相信沒有比複製整個風格更輕的方式。 所以我發現默認的ListViewItem樣式使用以下刷的選擇:ListViewItem選擇顏色覆蓋
<UserControl.Resources>
<SolidColorBrush x:Key="ListViewItemPointerOverBackgroundThemeBrush" Color="Yellow" />
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="Yellow" />
<SolidColorBrush x:Key="ListViewItemSelectedForegroundThemeBrush" Color="Yellow" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="Yellow" />
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="Yellow" />
</UserControl.Resources>
注:我已經把所有的刷子我的用戶,以及他們都設置爲黃色。但我的UI中沒有任何黃色,唉。 所以問題是:我如何強制默認模板使用我的重寫刷? 第二個(可選)問題:也許我做錯了,有更好的方法來實現我的目標?
謝謝,但應用廣泛刷設置真的不是我的選擇。如果沒有其他選擇,我會接受它作爲答案,但。 – ixSci 2013-02-14 10:34:49
我剛剛在設置頁面出現了這個問題,並且我在MSDN上發現了一個線程,Tim Heuer回覆說,只刷寫頁面的刷子是不可能的,僅適用於app.xaml。該線程於11月最後更新。不禁想到一定有辦法.. – 2013-02-14 12:24:30