private void OnPopupPreviewMouseUp(object sender, MouseButtonEventArgs e) { // Ignore mouse up when mouse donw is on expand button if (isButtonClicked) { isButtonClicked = false; e.Handled = true; } }