使用MindFusion.Scheduling for WPF將自定義實現資源視圖的外觀以達到更美觀的演示。視圖的外觀自定義是通過設置Calendar.ResourceViewSettings對象的各種屬性來達到的。我們將在銀色主題上創建我們的演示,通過降低色彩的清晰度和對比度,使字體均勻的橫跨整個視圖。自定義過程分為以下步驟:
自定義的視圖背景:
1calendar.ResourceViewSettings.CalendarStyle. Brushes.White;< /code>
自定義行標題:
1234567calendar.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);
自定義視圖單元格:
1234calendar.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;
自定義視圖時間表:
123456789101112calendar.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;
字體,headerFont和borderBrush變量定義如下:
123FontFamily font =
new
FontFamily(
"Segoe UI"
);
FontFamily headerFont =
new
FontFamily(
"Segoe UI Light"
);
Brush borderBrush =
new
SolidColorBrush(Color.FromArgb(255, 224, 224, 224));
最後的結果將顯示在下方。
本文出自 “sellen技術關注” 博客,請務必保留此出處http://sellen018.blog.51cto.com/7935886/1300704