Tuvalimde bazı özel denetimlerim var.WPF'de Seç ve Sürükle arasında fark yaratın
Bu kontroller sürükle ve bırak ile hareket ettirilebilir veya tıklanarak seçilebilir.
Şimdiprotected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnPreviewMouseLeftButtonDown(e);
this.isDragInProgress = false;
// Cache the mouse cursor location.
this.origCursorLocation = e.GetPosition(this);
// Walk up the visual tree from the element that was clicked,
// looking for an element that is a direct child of the Canvas.
var source = e.Source;
var element = this.FindCanvasChild(source as DependencyObject);
if (element == null || !(element is MyControl))
return;
this.ElementBeingDragged = element;
// Get the element's offsets from the four sides of the Canvas.
this.draggedLeft = Canvas.GetLeft(this.ElementBeingDragged);
this.darggedTop = Canvas.GetTop(this.ElementBeingDragged);
// Set the Handled flag so that a control being dragged
// does not react to the mouse input.
e.Handled = true;
this.isDragInProgress = true;
}
, benim sorunum ben hiçbir MouseClick olay özel üzerinde bulunmaktadır (... üzerinde MyControl tıklayarak seçemezsiniz şudur:
Şimdi, Sürükle uygulanan ve böyle bir şey Bırak Kontrol, ne de MouseDown şimdi çalışıyor ..)
e.Handled = true;
yorumunu bildirirseniz, kontrol siz sürüklerken bu seçimi değiştirecektir, eğer yorum yapmazsanız, kontrol siz onu değiştirmeyecektir .... (