private void UndoBtn_MouseDown(object sender, MouseButtonEventArgs e) { if (PaintMenuPnl.Children.Contains(myHandMenu)) { myPaint.UndoHand(); } else { myPaint.Undo(); } }