public MainWindow() { InitializeComponent(); _captureElement = this; Mouse.AddGotMouseCaptureHandler((DependencyObject)_captureElement, stackPanel1_GotLostMouseCapture); Mouse.AddLostMouseCaptureHandler((DependencyObject)_captureElement, stackPanel1_GotLostMouseCapture); Mouse.Capture(_captureElement); MouseCaptured = Mouse.Captured != null; }
private void CalendarHelper_Loaded(object sender, RoutedEventArgs e) { Mouse.AddGotMouseCaptureHandler(Target, GlobalMouseCapture); }