WPF style about calendar

Source: Internet
Author: User

Recently I used the calendar control when writing a program. In the program, a large calendar is required because the touch screen is used,
Because it can be dragged out directly when you use calendar, you have not paid much attention to the calendar owner.
Because I have not been familiar with WPF for a long time, I set the calendar style for half a day, so I wrote it on my blog.
It is completely for some new users. It is also a kind of communication to hope to help them,
There may still be many shortcomings, but they mainly provide some small information for new users. As for how to make full use of them, ^.

1. Increase the calendar size.

Drag a calendar control in Microsoft Expression blend 4 and right-click it.
Select edit a copy... in edit template, and then enter the control, and then in XAML
Delete the <stackpanel/> label,Note that <stackpanel/> there is also a <calendaritem/> do not delete, only delete <stackpanel/>

2. Set the calendardaybutton attribute of the calendar.
After completing the first step, create a resource. For resources of the calendardaybutton, see the following:
<Window. Resources>
<Style targettype = "calendardaybutton" X: Key = "calendardaybutton">
<Style. triggers>
<Eventtrigger routedevent = "calendardaybutton. Click">
<! -- <Sele property = "isvisible" value = "false"/> -->
</Eventtrigger>

</Style. triggers>
<Setter property = "width" value = "70"/>
<Setter property = "height" value = "70"/>
<Setter property = "fontsize" value = "20"/>
<Setter property = "foreground" value = "blue"/>
<! -- <Setter property = "background" value = "white"/> -->
<Setter property = "background">
<Setter. value>
<Radialgradientbrush>
<Gradientstop color = "# ffa1a1a1" offset = "0"/>
<Gradientstop color = "# ff8babce" offset = "0.8"/>
<Gradientstop color = "# ff8babce" offset = "1"/>
</Radialgradientbrush>
</Setter. value>
</Setter>
</Style>
</Window. Resources>
Then, the resource: calendardaybuttonstyle = "{staticresource calendardaybutton}" is referenced in the calendardaybutton attribute of the calendar }"
Then OK
**************************************** *****************************
I hope some experts can teach WPF some learning suggestions and guidance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.