|
|
@@ -806,10 +806,7 @@ public class CalendarControl : ContentControl
|
|
|
{
|
|
|
e.Handled = true;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- parent.Block_MouseLeftButtonDown(this, e);
|
|
|
- }
|
|
|
+ parent.Block_MouseLeftButtonDown(this, e);
|
|
|
};
|
|
|
ContentControl.MouseLeftButtonUp += (o, e) =>
|
|
|
{
|
|
|
@@ -856,6 +853,8 @@ public class CalendarControl : ContentControl
|
|
|
|
|
|
if(e.LeftButton == MouseButtonState.Pressed)
|
|
|
{
|
|
|
+ _parent.CancelPressedAction();
|
|
|
+
|
|
|
ClearAdorner();
|
|
|
|
|
|
var point = e.GetPosition(this);
|
|
|
@@ -1629,13 +1628,14 @@ public class CalendarControl : ContentControl
|
|
|
onHeld();
|
|
|
}, cts.Token, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
|
|
|
}
|
|
|
+ private void CancelPressedAction()
|
|
|
+ {
|
|
|
+ cts?.Cancel();
|
|
|
+ }
|
|
|
private void ReleasedAction(Action onRelease)
|
|
|
{
|
|
|
- if(cts is not null)
|
|
|
- {
|
|
|
- cts.Cancel();
|
|
|
- onRelease();
|
|
|
- }
|
|
|
+ cts?.Cancel();
|
|
|
+ onRelease();
|
|
|
}
|
|
|
|
|
|
private void CallBlockEvent(EventHandler<CalendarBlockEventArgs>? e, UIElement? parent, CalendarBlockEventArgs args)
|