Use MindFusion. Scheduling for WPF to customize the appearance of the resource view for better presentation. You can customize the view appearance by setting various attributes of the Calendar. ResourceViewSettings object. We will create our demo on a silver theme to make the font even across the entire view by reducing the definition and contrast of the color. The custom process consists of the following steps:
Custom view Background:
1 |
calendar.ResourceViewSettings.CalendarStyle. Brushes.White;< /code> |
Custom line title:
1234567 |
calendar.ResourceViewSettings.ExpandableRows = false ; calendar.ResourceViewSettings.HeaderStyle.FontFamily = headerFont; calendar.ResourceViewSettings.HeaderStyle.FontSize = 13; calendar.ResourceViewSettings.HeaderStyle.Foreground = new SolidColorBrush(Color.FromArgb(255, 64, 64, 64)); calendar.ResourceViewSettings.HeaderStyle. Brushes.White;< /code> calendar.ResourceViewSettings.HeaderStyle.BorderBrush = borderBrush; calendar.ResourceViewSettings.HeaderStyle.BorderThickness = new Thickness(0, 0, 0, 1); |
Custom view cell:
1234 |
calendar.ResourceViewSettings.CellStyle. Brushes.White;< /code> calendar.ResourceViewSettings.CellStyle.BorderBrush = borderBrush; calendar.ResourceViewSettings.WeekendStyle.Background = new SolidColorBrush(Color.FromArgb(255, 250, 250, 250)); calendar.ResourceViewSettings.WeekendStyle.BorderBrush = borderBrush; |
Custom view timeline:
123456789101112 |
calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle. Brushes.White;< /code> calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.BorderBrush = borderBrush; calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontFamily = headerFont; calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontSize = 13; calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontWeight = FontWeights.Normal; calendar.ResourceViewSettings.BottomTimelineSettings.NowFillBrush = Brushes.Transparent; calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle. Brushes.White;< /code> calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.BorderBrush = borderBrush; calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontFamily = headerFont; calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontSize = 13; calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontWeight = FontWeights.Normal; calendar.ResourceViewSettings.MiddleTimelineSettings.NowFillBrush = Brushes.Transparent; |
The font, headerFont, and borderBrush variables are defined as follows:
123 |
FontFamily font = new FontFamily( "Segoe UI" ); FontFamily headerFont = new FontFamily( "Segoe UI Light" ); Brush borderBrush = new SolidColorBrush(Color.FromArgb(255, 224, 224, 224)); |
The final result is shown below.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/19462J534-0.jpg "width =" 670 "height =" 410 "style =" margin: 0px; padding: 0px; border: 0px; "alt =" WPF-Sample.jpg "/>
This article is from the "sellen technology follow" blog, please be sure to keep this source http://sellen018.blog.51cto.com/7935886/1300704