开发者

WPF diagonal line drag and drop

开发者 https://www.devze.com 2023-02-20 23:53 出处:网络
How can I write in WPF diagonal line with drap and drop behavior? I need to move it to the left and right,

How can I write in WPF diagonal line with drap and drop behavior?

I need to move it to the left and right, And if drag it from the top or bottom than to rotate it.

My original post can be found under this link

-----------------Edit-------------------------------------------------------

I am able to draw diagonal line with drag and drop, my problem is the mouse event area for his drag and drop is a whole square and not only the line, so basically now I can move the line without the mouse to be over the line, this causes another problem, that I can't move other controls inside this square range.

-----------------Second Edit------------------------------------------------

Now I was able t开发者_Python百科o rotate I just used

<Rectangle Fill="Blue" IsHitTestVisible="False" x:Name="m_Rect">
  <Rectangle.RenderTransform>
     <TransformGroup>     
          <RotateTransform Angle="45"/>
     </TransformGroup>
   </Rectangle.RenderTransform>            
 </Rectangle>

And that helped me to creat the diagonal line with drag and drop behavior Now my problem is that inside the event in c# the rectangle is out of scope..


I managed to do it,

You can download the code here

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号