'宣言 Public Property CalendarDimensions As CalendarDimensions
public CalendarDimensions CalendarDimensions {get; set;}
CalendarDimensions は XamMonthCalendar のテンプレート内の CalendarItemGroupPanel で使用されます。作成して配置する CalendarItemGroup の行および列の最小数を決定するために使用されます。AutoAdjustCalendarDimensions がデフォルト値の True で、CalendarItemGroupPanel がモード グループを表示するスペースがある場合、自動的に MaxGroups までの追加のグループを作成されます。
CalendarItemGroupPanel を含まないように XamMonthCalendar を再テンプレートする場合、このプロパティはコントロールの表示に影響されません。
Imports Infragistics.Windows.Editors Imports Infragistics.Windows.Controls Private Sub InitializeCalendar(ByVal calendar As XamMonthCalendar) ' by default the template of the xammonthcalendar uses a calendaritemgrouppanel ' which will automatically create groups as needed based on the available size ' to use a fixed size, you can set AutoAdjustCalendarDimensions to false and ' set the CalendarDimensions to the dimensions you want it to always use calendar.AutoAdjustCalendarDimensions = False calendar.CalendarDimensions = New CalendarDimensions(2, 2) ' DisabledDaysOfWeek is a flagged enumeration of the days of the week ' that should be disabled and therefore disallow activation and selection calendar.DisabledDaysOfWeek = DayOfWeekFlags.Saturday Or DayOfWeekFlags.Sunday ' the default selection type allows for selection of multiple dates calendar.SelectionType = SelectionType.Single ' the min/max dates control the range of dates that are available ' for activation/selection. any dates outside this range will not ' be shown calendar.MinDate = New DateTime(2008, 1, 1) calendar.MaxDate = New DateTime(2099, 12, 31) ' by default week numbers are not displayed calendar.WeekNumberVisibility = Visibility.Visible ' the today button that is used to select the current date ' can be removed using the TodayButtonVisibility calendar.TodayButtonVisibility = Visibility.Collapsed ' by default leading and trailing dates (e.g. days before ' and after the first/last visible month) are displayed ' within the control calendar.ShowLeadingAndTrailingDates = False End Sub
using Infragistics.Windows.Editors; using Infragistics.Windows.Controls; private void InitializeCalendar(XamMonthCalendar calendar) { // by default the template of the xammonthcalendar uses a calendaritemgrouppanel // which will automatically create groups as needed based on the available size // to use a fixed size, you can set AutoAdjustCalendarDimensions to false and // set the CalendarDimensions to the dimensions you want it to always use calendar.AutoAdjustCalendarDimensions = false; calendar.CalendarDimensions = new CalendarDimensions(2, 2); // DisabledDaysOfWeek is a flagged enumeration of the days of the week // that should be disabled and therefore disallow activation and selection calendar.DisabledDaysOfWeek = DayOfWeekFlags.Saturday | DayOfWeekFlags.Sunday; // the default selection type allows for selection of multiple dates calendar.SelectionType = SelectionType.Single; // the min/max dates control the range of dates that are available // for activation/selection. any dates outside this range will not // be shown calendar.MinDate = new DateTime(2008, 1, 1); calendar.MaxDate = new DateTime(2099, 12, 31); // by default week numbers are not displayed calendar.WeekNumberVisibility = Visibility.Visible; // the today button that is used to select the current date // can be removed using the TodayButtonVisibility calendar.TodayButtonVisibility = Visibility.Collapsed; // by default leading and trailing dates (e.g. days before // and after the first/last visible month) are displayed // within the control calendar.ShowLeadingAndTrailingDates = false; }