2017-01-02 45 views
2

我需要改變,在UWP,瀨越MDL2資產字體CalendarDatePicker內的顏色,使它看起來像這樣(藍色圖標):更改CalendarGlyph的前景財產CalendarDatePicker

enter image description here

我「看着已經在我的應用程序的DINAMIC樹,我相信我需要改變CalendarDatePicker CalendarGlyph的‘前景’屬性:

enter image description hereenter image description here

我知道如何將樣式應用於CalendarDatePicker,但我不知道如何將樣式應用於CalendarDatePicker中的特定元素。

+0

使用融爲一體,右鍵單擊元素,應該是這樣的風格 - >編輯複製 – Alex

回答

3

你需要重寫CalendarDatePickerCalendarGlyphForeground的SolidColorBrush資源:

<CalendarDatePicker> 
    <CalendarDatePicker.Resources> 
     <SolidColorBrush x:Key="CalendarDatePickerCalendarGlyphForeground" Color="CornflowerBlue"/> 
    </CalendarDatePicker.Resources> 
</CalendarDatePicker> 

若要將此所有日曆日期選擇器,範圍適當資源(例如,把它放在Application.Resources資源字典在App.xaml.cs它在應用程序範圍內應用)。

Screenshot

+0

完美!這正是我所期待的! – CarlosTI