This is a WPF application with C#.
I have UserControls on a canvas. I have enabled the ability to drag and move these UserControls anywhere on the canvas. The problem comes up when these UserControls have an extender in them. For some reason, it would appear that the extender is not getting the event. So it never extends.
I'm wondering how to fix this. Now if i set Handled to false, it will extend, but my click and dragging will lock up fairly randomly, normally within 2-3 drags.
event is
DragFinish just takes a bool to know if it was cancelled or not, so this is saying on the mouseup event, to finish the drag (set the object down) and handle the event. The start code always starts on the mouse button down. It looks like...
so with those two functions, if i turn either of the e.handled to true, i can't extend, if i have them the way i have it now, it locks up. So what i'm trying to figure out is how i can in this event, send a mouseUp event to the extender.
sorry if i seemed to kind of jumble around a bit, but this problem is confusing.
To recap:
setting handled to false allows me to extend, but freezes when i move the object.
setting handled to true allows me to move, but i cannot extend.
I have UserControls on a canvas. I have enabled the ability to drag and move these UserControls anywhere on the canvas. The problem comes up when these UserControls have an extender in them. For some reason, it would appear that the extender is not getting the event. So it never extends.
I'm wondering how to fix this. Now if i set Handled to false, it will extend, but my click and dragging will lock up fairly randomly, normally within 2-3 drags.
event is
Code:
protected override void OnPreviewMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
{
if (m_isDown)
{
DragFinished(false);
(m_originalElement as ComponentControl).
e.Handled = true;
}
}
Code:
protected override void OnPreviewMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e)
{
if (e.Source != this)
{
m_isDown = true;
m_startPoint = e.GetPosition(this);
m_originalElement = e.Source as UIElement;
}
e.Handled = false;
base.OnPreviewMouseLeftButtonDown(e);
}
sorry if i seemed to kind of jumble around a bit, but this problem is confusing.
To recap:
setting handled to false allows me to extend, but freezes when i move the object.
setting handled to true allows me to move, but i cannot extend.
Comment