 This is a very short video that shows how to drag and drop a control in Windows presentation foundation. This video is an excerpt from video number 71. I don't usually repeat video content, but getting this to work in WPF took me hours to figure out how to do it because I couldn't find any good examples anywhere. I also wanted to make a small how-to video with drag and drop in the title to make it easier to find on YouTube or on the internet. I'll put a link to the code in the description under this video so you can just copy and paste it and use it, okay? One of the things I wanted to show you was this code behind for moving like the rectangle around, okay? And the reason why is I could not find a decent example of how to do this anywhere. And I was beating my head trying to figure out how to make this work. I literally saw examples doing the same kind of thing with like two pages of code. And after some poking around and playing around, and as you can see, doing some debugging, I finally got it down to a couple subroutines. And they're event-driven, so when you get the mouse button event down, so when you use the left mouse button and click the node, or the router in our case, it populates this point origin variable or object with the X and Y location of the router, all right? And then this translation point is a translate transform object. And it's just measuring how far away we are from these origin points. This is when you do the left click down, it records this information, right? So then you start moving the mouse, you start getting, this is saying, okay, the mouse is moving. So it's going to get the location of where the mouse is moving. It's going to check to see if the left mouse button is pressed. So this one is, okay, I pressed on it. And now the mouse is moving and it's double checking, okay, is the left mouse button still pressed? In other words, have you left clicked on it and are dragging it, right? And it's going to say, okay, I want to translate point X to mouse location minus the point origin dot X and translate point Y to mouse location point Y minus the point origin. And then I'm going to actually move it. So it's going to say, okay, move UC node, render the transformer, which means move it to the translation points that we just assigned right here, the X and Y points. And that's how you make it move around. And this right here would probably be a good video on its own, just a little five-minute or less than that one-minute video on how to do a drag and drop with a control and WPF, because this literally took me hours to figure out how to make it work. And why Microsoft doesn't have a built-in function for this is a head scratcher. I wish, if someone knows, I wish they would let me know why this isn't just something that's a library and WPF. Well, that's it. I hope it works for you too. If you liked this video, give it a big thumbs up. That helps and hit the subscribe button. That really helps too. Thanks for watching and I'll see you next time.