バージョン

MaxDate プロパティ

コントロールに選択またはアクティブ化できる優先日付の最大値を取得または設定します。
シンタックス
'宣言
 
Public Property MaxDate As Date
public DateTime MaxDate {get; set;}
解説

MaxDate および MinDate はエンド ユーザーが使用できる日付の範囲を制御するために使用されます。その範囲以外の日は表示されません。

DisabledDates および DisabledDaysOfWeek は MinDate/MaxDate 範囲内の日付の選択/アクティブ化ができないようにするために使用されます。

注: コントロールのカルチャーの System.Globalization.Calendar.MaxSupportedDateTimeSystem.Globalization.Calendar.MinSupportedDateTime に許可される値以外の場合、実際に使用できる範囲は MinDate および MaxDate で指定された範囲よりも小さい可能性があります。使用されるカルチャーは System.Windows.FrameworkElement.Language プロパティに基づいて設定されます。

使用例
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.Controls

    Private Sub InitializeCalendar(ByVal calendar As XamMonthCalendar)
        ' the DisabledDates is a collection of CalendarDateRange objects
        ' that can be used to disable one or more specific dates
        Dim range1 As CalendarDateRange = New CalendarDateRange(New DateTime(2008, 12, 25))
        calendar.DisabledDates.Add(range1)

        Dim range2 As New CalendarDateRange
        range2.Start = New DateTime(2009, 1, 1)
        range2.End = New DateTime(2009, 1, 5)
        calendar.DisabledDates.Add(range2)

        ' since disabled days of the week cannot be activated/selected, you can
        ' choose to hide them from the display
        calendar.ShowDisabledDaysOfWeek = False

        ' 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 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)
    End Sub
using Infragistics.Windows.Editors;
using Infragistics.Windows.Controls;

        private void InitializeCalendar(XamMonthCalendar calendar)
        {
            // the DisabledDates is a collection of CalendarDateRange objects
            // that can be used to disable one or more specific dates
            CalendarDateRange range1 = new CalendarDateRange(new DateTime(2008, 12, 25));
            calendar.DisabledDates.Add(range1);

            CalendarDateRange range2 = new CalendarDateRange();
            range2.Start = new DateTime(2009, 1, 1);
            range2.End = new DateTime(2009, 1, 5);
            calendar.DisabledDates.Add(range2);

            // 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;

            // since disabled days of the week cannot be activated/selected, you can
            // choose to hide them from the display
            calendar.ShowDisabledDaysOfWeek = false;

            // 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);
        }
<UserControl x:Class="Xaml.UserControl1"
    
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
xmlns:igEditors="http://infragistics.com/Editors"
    
xmlns:igThemes="http://infragistics.com/Themes">
    
<igEditors:XamMonthCalendar
        
x:Name="xamMonthCalendar1"
        
DisabledDaysOfWeek="Saturday, Sunday"
        
ShowDisabledDaysOfWeek="False"
        
MinDate="1/1/2000"
        
MaxDate="12/31/2099">
        
<igEditors:XamMonthCalendar.DisabledDates>
            
<igEditors:CalendarDateRange Start="1/1/2009" End="1/5/2009" />
            
<igEditors:CalendarDateRange>12/25/2008</igEditors:CalendarDateRange>
        
</igEditors:XamMonthCalendar.DisabledDates>
    
</igEditors:XamMonthCalendar>
</UserControl>
参照