1

Based on this article, I create a sector shape. https://stackoverflow.com/a/16669648/7284989

<controls:sector  Center="{Binding Path=CenterPosition, Converter={StaticResource PointConverter}}" 
        Stroke="White" StrokeThickness="5"
        SnapsToDevicePixels="True"
        StartAngle="0" 
        EndAngle="{Binding Path=DeltaAngle}"
        SmallAngle="True"
        Radius="100"/>

It draws a pie shape Sector, and I want to redraw with different angle. I made it work with slider, but I'm trying to do it without slider and just mousemvoement.

I tried to capture the start and end of mousemovement, so I can compare them. Maybe then I can get positive or negative movement to increase or decrease the angle of this Pie.

I've been search many postings, but all I can find was drag and drop which requires mouse click. However, I do not want mouse click to initiate it. I would rather check(or turn on) the state and increase/decrease multiple time to adjust the size before I stop it.

So is there a way to capture the initial position of mouse and end position of mouse without clicking a button?

I tried to use CaptureMouse() but all the references I found was too partial, and not even sure that is right to use for such functionality.

Could anybody guide me?

Community
  • 1
  • 1
tk.hfes
  • 57
  • 8
  • Well on what event you want to start and stop the capture of a mouse movement ? – Versatile Feb 17 '17 at 17:28
  • just listen to mouse move – patrick Feb 17 '17 at 17:29
  • @Versatile on Mousemove event, – tk.hfes Feb 17 '17 at 18:39
  • @Patrick How would I know which one is start and which one is end? – tk.hfes Feb 17 '17 at 18:39
  • @tk.hfes Always record current mouse move. When you "check(or turn on) the state" look at the last mouse move, and set that to start. When you uncheck state... set it to end. – patrick Feb 17 '17 at 18:42
  • @Patrick that does not quite work for my case. Say if I move my mouse left(negative) then I want to adjust little to right(positive). Since start point stays same, if I compare two point, I get negative value. Is there a way to reassign end point to start? Maybe I'm thinking it wrong... – tk.hfes Feb 22 '17 at 19:31
  • @tk.hfes if you move the mouse to the left I would expect a negative X value, if you move to the right I expect positive X value. I think you need to re-explain what you are trying to accomplish it's still unclear. – patrick Feb 22 '17 at 20:17

0 Answers0