Thank you so much, I was gonna ask about the implementation in ListView, but you said that at the end of the video. I will be waiting for that and more.
@SingletonSean3 жыл бұрын
Correct Boukri, that will be coming soon! 😄 I think the source code has the ListView implementation if you're interested in seeing it. I'll admit it's a bit complex.
@boukriabdelkhalek68553 жыл бұрын
@@SingletonSean I will check it after all :D
@PanCave2 жыл бұрын
I know this video isn't new anymore, but it really helped me a lot! Can you tell me, how to avoid that first jumping, when movng the mouse? I assume this happens, because we don't click on the most top left edge of the square and so it snaps to the position of the mouse. I guess you'd somehow have to calculate the mouse offset?
@PanCave2 жыл бұрын
Actually I found a solution. In case anybody else is wondering about this: In the MouseDown EventHandler you can save an offsetLeft and offsetTop by getting e.GetPosition(frameworkElement).X and e.FetPosition(frameworkElement).Y respectively
@Brianboy94942 жыл бұрын
@@PanCave Thanks for the idea! I was wondering the same. If anyone wonders how to do this in more detail, you can declare a Point member currentMouseOffset and then in the rectangle's MouseDown event store e.GetPosition(rectangle) in there. Then, in the canvas's DragOver and Drop events you subtract that offset's x- and y-values from the mouse position to set the rectangles new position on the canvas. One must use the MouseDown event instead of the MouseMove event to obtain correct values for the offset.
@tjzIsMe3 жыл бұрын
Thanks for this! Wonderful timing too, I was just about to tackle this in my project! Appreciate your videos!
@SingletonSean3 жыл бұрын
Woohoo, thanks Joe!
@Tyronblade3 жыл бұрын
Great stuff thanks a lot! Ill be eagerly awaiting a video covering listview 😉
@SingletonSean3 жыл бұрын
Thanks TIRAN! I think the source code has the ListView implementation if you're interested in checking it out, but I think the video will clarify a lot of the concepts.
@mortuusars3 жыл бұрын
Would be interesting to see how to drag&drop from WPF app to another app window.
@SingletonSean3 жыл бұрын
Good point Evgeny, I haven't tried this. I think it might be easier than expected since drag and drop is "global" on Windows OS.
@mortuusars3 жыл бұрын
@@SingletonSean I've tried to implement drag and drop from my app window to photoshop window. (As if I drag image from windows explorer) and it didn't work. I've not spent much time on this, but I think it has something to do with what "datatype" other window expects.
@EcuTester Жыл бұрын
Good job! Thank you for YOUR WORK👍
@shaihulud45153 жыл бұрын
Thank you - without this tutorial I would have backed out of drag&drop entirely!
@SingletonSean3 жыл бұрын
Glad it was helpful Shai! Drag & drop just sounds so scary at first haha
@maxgdh7618 Жыл бұрын
Hello Could you please also explain how to implement drag to the dynamically created elements? I tried to do that, but as soon as I try to move a rectangle it disappears, even though that I use single canvas
@SpellMenderDev Жыл бұрын
I can help with that. In the MouseMove event handler you'll want to use the object "sender" instead of the name reference. You'll need to cast it to a different object type. A UIElement would work. In my case I used a Shape object so I could change the fill color. Here's a simple example of what you want: --- private void Element_MouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { DragDrop.DoDragDrop((UIElement)sender, new DataObject(DataFormats.Serializable, sender), DragDropEffects.Move); } } --- I know you posted this 8 months ago, but I hope it helps someone.
@TuberTugger2 жыл бұрын
I can't get errverr how easy this was
@bonehead-lo2pi4 ай бұрын
😂😂😂😂
@cyrildouglas92623 жыл бұрын
Do you plan to show the ways to implement this using MVVM?
@SingletonSean3 жыл бұрын
Definitely Cyril! That will be next 💪
@cyrildouglas92623 жыл бұрын
Thank you so mcuh, that would be great.
@GuildOfCalamity3 жыл бұрын
When you get time, could you do a quick video on all the Extentions/SDKs/Tools you have installed in your VS2019?
@SangTruongITE Жыл бұрын
thank you very much! By the way, can you tell me why my rectangle can drag outside of the canvas?
@minimalcoder32363 жыл бұрын
I was trying to create a custom reporting tool that customers can drog and drop labels, images or draw lines and rectangles, and save the report for later use. But could not find where to start. Do you have a suggestion for me ? liked & subbed
@feitan87453 жыл бұрын
A builder tool?
@minimalcoder32363 жыл бұрын
@@feitan8745 yes you are correct
@matthiasmerz863 жыл бұрын
Hy. Can you show a Drag&Drop-Excample for a List? Based on your example, I would like to create these lists variably and then be able to move them among each other. In addition, it should still be possible to move the contents of the list among each other. could you show an example, please.
@JarosawPietras3 жыл бұрын
UserControl is not serializable, how drag drop UserControl?
@technics62152 жыл бұрын
Thank you Sir!
@mikefocal57703 жыл бұрын
GREAT JOB
@SingletonSean3 жыл бұрын
Thanks mike!
@RGBA3 жыл бұрын
great tutorials but when i try to move my box to the right it wont move it only let me move to left and bottom, fix?
@elkhayyat853 жыл бұрын
Thank you Sir for your Tutorial... it's really awesome and so helpful... :) :) can you you make some tutorial about how to customize a GridView and make it with awesome look and functions.?
@y4ni6082 жыл бұрын
awesome video loved it :D
@John-vv7ok2 жыл бұрын
is there any possiblitiy of doing this without XAML?
@gary62129 ай бұрын
Note: Set playback speed to .75 for human speed.
@SingletonSean9 ай бұрын
👽👽👽
@DerEddieLoL2 жыл бұрын
Would you implement 64 of those boxes to make a chess game? I think this would be pretty tedious... any suggestions? I am new to WPF
@SingletonSean2 жыл бұрын
I imagine it would be something like that! I feel like this wouldn't be that crazy to create, but would certainly be somewhat difficult. I've actually done 2 drag and drop projects in the past that are related to this. The drag and drop is the easy part, but the hard part is enforcing a "grid" structure that the draggable pieces will snap to. Since I have some experience with this and some old source code, I'd love to do a video on the "grid" behavior. It's super satisfying too, hahah. Thanks for bringing up this topic!
@leonhardolaye-felix88112 жыл бұрын
THANKS
@scproinc2 жыл бұрын
Doesn't work with tree view items.
@evgeniilewicki58744 ай бұрын
This seems to be useful information, but you chatter as if two people with whips are urging you on behind your back.