2013-04-02 91 views

回答

0

我不相信你會有任何改變這種行爲的運氣。使日期選擇器以關閉碼似乎是這裏(I看着日期選擇器從Silverlight Toolkit,釋放所述源 - >的Silverlight 4 - >來源 - >控制 - >的DatePicker)

private void Calendar_DayButtonMouseUp(object sender, MouseButtonEventArgs e) 
     { 
      this.Focus(); 
      this.IsDropDownOpen = false; 
      _calendar.ReleaseMouseCapture(); 
     } 

它也關閉在這裏:

private void Calendar_KeyDown(object sender, KeyEventArgs e) 
     { 
      Calendar c = sender as Calendar; 
      Debug.Assert(c != null, "The Calendar should not be null!"); 

      if (!e.Handled && (e.Key == Key.Enter || e.Key == Key.Space || e.Key == Key.Escape) && c.DisplayMode == CalendarMode.Month) 
      { 
       this.Focus(); 
       this.IsDropDownOpen = false; 

       if (e.Key == Key.Escape) 
       { 
        this.SelectedDate = this._onOpenSelectedDate; 
       } 
      } 
     } 

這些處理器無論是在私有方法,private void InitializeCalendar相加,壓延對象本身聲明爲private(private Calendar _calendar)。

+0

我認爲你是對的,即使它不是我想聽到的答案! – AlexFoxGill

相關問題