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
Expand|Select|Wrap|Line Numbers
- protected override void OnPreviewMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
- {
- if (m_isDown)
- {
- DragFinished(false);
- (m_originalElement as ComponentControl).
- e.Handled = true;
- }
- }
Expand|Select|Wrap|Line Numbers
- 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.