Parent Canvas mouse button effecting on Child Canvas
-
Hi, I am developing one silverlight application in that I placed one main canvas(LayoutRoot) and there are 6 child canvas are there with videos.I have written mouse events for main canvas and child canvas seperately.Purpose when I drag and drop main canvas it will drag entire canvas with child canvas and if I drag one of the child canvas it shouldn't drag main canvas too only drag one that particular canvas.I am facing problem that if I drag main canvas its working good and if I try to drag one of those child canvas it is dragging main canvas also.Can you please anybody help me how to stop main canvas mouse button events wont effect on child canvas. Thanks in Advance Pavani
-
Hi, I am developing one silverlight application in that I placed one main canvas(LayoutRoot) and there are 6 child canvas are there with videos.I have written mouse events for main canvas and child canvas seperately.Purpose when I drag and drop main canvas it will drag entire canvas with child canvas and if I drag one of the child canvas it shouldn't drag main canvas too only drag one that particular canvas.I am facing problem that if I drag main canvas its working good and if I try to drag one of those child canvas it is dragging main canvas also.Can you please anybody help me how to stop main canvas mouse button events wont effect on child canvas. Thanks in Advance Pavani
Are you marking the mouse events "handled" after you handle them?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Are you marking the mouse events "handled" after you handle them?
Mark Salsbery Microsoft MVP - Visual C++ :java:
thank you for your response. I have written the mouse down,mouse up and mouse move events for parent canvas and child canvas to drag and drop those canvas. But If I drag parent cavas it is working fine if i try to drag child canvas parent canvas events are also firing.So,I have put e.handled=true in child canvas mouse down and mouse up events now its not firing parent canvas mouse down and mouse up but parent canvas mouse move event is firing.Because of that if I drag child canvas parent canvas is also dragging.Please help me how to stop firing parent canvas mouse move event.there is no handled=true in mouse move event to set.
-
Are you marking the mouse events "handled" after you handle them?
Mark Salsbery Microsoft MVP - Visual C++ :java:
I have written the mouse down,mouse up and mouse move events for parent canvas and child canvas to drag and drop those canvas. But If I drag parent cavas it is working fine if i try to drag child canvas parent canvas events are also firing.So,I have put e.handled=true in child canvas mouse down and mouse up events now its not firing parent canvas mouse down and mouse up but parent canvas mouse move event is firing.Because of that if I drag child canvas parent canvas is also dragging.Please help me how to stop firing parent canvas mouse move event.there is no handled=true in mouse move event to set.
-
I have written the mouse down,mouse up and mouse move events for parent canvas and child canvas to drag and drop those canvas. But If I drag parent cavas it is working fine if i try to drag child canvas parent canvas events are also firing.So,I have put e.handled=true in child canvas mouse down and mouse up events now its not firing parent canvas mouse down and mouse up but parent canvas mouse move event is firing.Because of that if I drag child canvas parent canvas is also dragging.Please help me how to stop firing parent canvas mouse move event.there is no handled=true in mouse move event to set.
I typically just add a flag to my class like "bool isInDrag;". Set the flag true on mousedown, false on mouse up, and only handle mousemove event if the flag is true. You may need two flags if your handlers are in the same class ;)
Mark Salsbery Microsoft MVP - Visual C++ :java: