开发者

DatePicker day colors WPF 4

开发者 https://www.devze.com 2023-01-10 05:04 出处:网络
I have the following style for the text block in the dictionary <Style TargetType=\"{x:Type TextBlock}\">

I have the following style for the text block in the dictionary

<Style TargetType="{x:Type TextBlock}">
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="Margin" Value="5,0,0,0 "/>
    <Setter Property="Foreground" Value="White" />
</Style>

after setting this in the resource dictionary, all the text block i have used in my project have foreground color to white which I have set, now the problem is that the datepicker control when open only shows the selected date, as I have set the foreground color of white for the text block in the above style the date picker control dates are not开发者_StackOverflow中文版 showing. Please help me as soon as possible as I am stuck in this problem :(


You can use additional style for your DatePicker:

<DatePicker>
        <DatePicker.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="Foreground" Value="Black"/>
            </Style>
        </DatePicker.Resources>
    </DatePicker>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号