From 35907b1ecc5c94096cf94c41434535fc0bddcc31 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Mon, 21 Mar 2011 16:23:04 +0000 Subject: [PATCH] DateTimePicker: minor fix with Calendar not releasing the mouse capture. --- .../Implementation/DateTimePicker.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs index 27055917..9938a1eb 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs @@ -1,16 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows.Controls.Primitives; namespace Microsoft.Windows.Controls { @@ -149,6 +141,12 @@ namespace Microsoft.Windows.Controls _calendar.SelectedDate = SelectedDate; } + protected override void OnPreviewMouseUp(MouseButtonEventArgs e) + { + if (Mouse.Captured is CalendarItem) + Mouse.Capture(null); + } + #endregion //Base Class Overrides #region Event Handlers