程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> 關於C語言 >> 如何使用MindFusion.Scheduling for WPF控件自定義WPF資源視圖外觀

如何使用MindFusion.Scheduling for WPF控件自定義WPF資源視圖外觀

編輯:關於C語言

使用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 = newSolidColorBrush(Color.FromArgb(255, 64, 64, 64));calendar.ResourceViewSettings.HeaderStyle. Brushes.White;< /code>calendar.ResourceViewSettings.HeaderStyle.BorderBrush = borderBrush;calendar.ResourceViewSettings.HeaderStyle.BorderThickness = newThickness(0, 0, 0, 1);

自定義視圖單元格:

1234calendar.ResourceViewSettings.CellStyle. Brushes.White;< /code>calendar.ResourceViewSettings.CellStyle.BorderBrush = borderBrush;calendar.ResourceViewSettings.WeekendStyle.Background = newSolidColorBrush(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 = newFontFamily("Segoe UI");FontFamily headerFont = newFontFamily("Segoe UI Light");Brush borderBrush = newSolidColorBrush(Color.FromArgb(255, 224, 224, 224));

最後的結果將顯示在下方。

WPF-Sample.jpg


本文出自 “sellen技術關注” 博客,請務必保留此出處http://sellen018.blog.51cto.com/7935886/1300704

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved