Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 更改CalendarDatePicker中CalendarGlyph的前台属性_C#_Xaml_Uwp_Win Universal App - Fatal编程技术网

C# 更改CalendarDatePicker中CalendarGlyph的前台属性

C# 更改CalendarDatePicker中CalendarGlyph的前台属性,c#,xaml,uwp,win-universal-app,C#,Xaml,Uwp,Win Universal App,我需要在UWP中更改CalendarDatePicker中Segoe MDL2 Assets字体的颜色,使其看起来像这样(蓝色图标): 我已经查看了我的应用程序的Dinamic树,我认为我需要更改CalendarDatePicker中CalendarGlyph的“前台”属性: 我知道如何将样式应用于CalendarDatePicker,但我不知道如何将样式应用于CalendarDatePicker内部的特定元素。您需要覆盖CalendarDatePickerCalendarGlyphFore

我需要在UWP中更改CalendarDatePicker中Segoe MDL2 Assets字体的颜色,使其看起来像这样(蓝色图标):

我已经查看了我的应用程序的Dinamic树,我认为我需要更改CalendarDatePicker中CalendarGlyph的“前台”属性:


我知道如何将样式应用于CalendarDatePicker,但我不知道如何将样式应用于CalendarDatePicker内部的特定元素。

您需要覆盖
CalendarDatePickerCalendarGlyphForeground
SolidColorBrush资源:

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

要将此应用于所有日历日期选择器,请适当地确定资源的范围(例如,将其放入App.xaml.cs中的
Application.Resources
resource字典中,以便应用于整个应用程序)


使用blend,右键单击元素,应该会出现类似样式->编辑copyPerfect!这正是我要找的!