共用方式為


DatePicker.FirstDayOfWeek 屬性

定義

取得或設定視為一週開頭的那一天。

public:
 property DayOfWeek FirstDayOfWeek { DayOfWeek get(); void set(DayOfWeek value); };
public DayOfWeek FirstDayOfWeek { get; set; }
member this.FirstDayOfWeek : DayOfWeek with get, set
Public Property FirstDayOfWeek As DayOfWeek

屬性值

DayOfWeek,表示一週的開頭。 預設為目前文化特性所決定的 FirstDayOfWeek

範例

下列範例會建立 , DatePicker 將星期一顯示為星期一的第一天。

DatePicker datePickerFor2009 = new DatePicker();
datePickerFor2009.SelectedDate = new DateTime(2009, 3, 23);
datePickerFor2009.DisplayDateStart = new DateTime(2009, 1, 1);
datePickerFor2009.DisplayDateEnd = new DateTime(2009, 12, 31);
datePickerFor2009.SelectedDateFormat = DatePickerFormat.Long;
datePickerFor2009.FirstDayOfWeek = DayOfWeek.Monday;

// root is a Panel that is defined elsewhere.
root.Children.Add(datePickerFor2009);
Dim datePickerFor2009 As New DatePicker()
datePickerFor2009.SelectedDate = New DateTime(2009, 3, 23)
datePickerFor2009.DisplayDateStart = New DateTime(2009, 1, 1)
datePickerFor2009.DisplayDateEnd = New DateTime(2009, 12, 31)
datePickerFor2009.SelectedDateFormat = DatePickerFormat.[Long]
datePickerFor2009.FirstDayOfWeek = DayOfWeek.Monday

' root is a Panel that is defined elsewhere. 
root.Children.Add(datePickerFor2009)
<!-- A DatePicker that has March 23, 2009 selected and 
           displays the Long date format. -->
<DatePicker SelectedDateFormat="Long" SelectedDate="3/23/09"
                  DisplayDateStart="1/01/09" DisplayDateEnd="12/31/09" 
                  FirstDayOfWeek="Monday"/>

備註

這個屬性會影響 CalendarDatePicker 。 如需詳細資訊,請參閱 Calendar.FirstDayOfWeek 屬性 (Property)。

相依性屬性資訊

識別碼欄位 FirstDayOfWeekProperty
設定為 的中繼資料屬性 true

XAML Attribute Usage

<DatePicker FirstDayOfWeek=「」 DayOfWeek />

適用於