WPF ListView/ItemsControl Drag Drop Adorner
-
Hi there, I've found this article by Bea Stollnitz and downloaded the source and converted to vb.net. I believe I have my conversion complete, but one thing is still not working as I've tried to get it and pulled too many hairs out. Hopefully someone can help me spot what I'm missing. Ok, drag & drop works fine in the converted code, I just don't get the InsertionAdorner working in vb.net, I've setup breakpoints in code and all code is being executed, but for the life of me the InsertionAdorner does not become visible. Even the DrawLine functions are being called! I'm at a loss and I need this in vb.net, the original C# project works just fine, I just can't find out what I'm missing! Thanks, Scott
-
Hi there, I've found this article by Bea Stollnitz and downloaded the source and converted to vb.net. I believe I have my conversion complete, but one thing is still not working as I've tried to get it and pulled too many hairs out. Hopefully someone can help me spot what I'm missing. Ok, drag & drop works fine in the converted code, I just don't get the InsertionAdorner working in vb.net, I've setup breakpoints in code and all code is being executed, but for the life of me the InsertionAdorner does not become visible. Even the DrawLine functions are being called! I'm at a loss and I need this in vb.net, the original C# project works just fine, I just can't find out what I'm missing! Thanks, Scott
If you want to convert this to VB.NET, use Reflector to open the exe up in Bea's solution (File > Open... pick the file). Then, expand the various items in DragDropListBox and choose Visual Basic in the language combo. Click Space to see the Disassembler window, and choose each class (e.g. Album) in turn. At the bottom of the Disassembler window is a link "Expand Methods" - click this to see the converted code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
-
If you want to convert this to VB.NET, use Reflector to open the exe up in Bea's solution (File > Open... pick the file). Then, expand the various items in DragDropListBox and choose Visual Basic in the language combo. Click Space to see the Disassembler window, and choose each class (e.g. Album) in turn. At the bottom of the Disassembler window is a link "Expand Methods" - click this to see the converted code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
Thanks for your reply, I'll give Reflector a go to see if I can see something, but with my experience the code that comes out of reflector can be somewhat cryptic at best. I did supply my attempt at converting the code in my original message, not sure if you downloaded and looked at it, the code I have compiles and runs fine in VB.net, just missing the InsertionAdorner working. Anyone willing to take a look at my already attempt at converting? Thanks, Scott
-
If you want to convert this to VB.NET, use Reflector to open the exe up in Bea's solution (File > Open... pick the file). Then, expand the various items in DragDropListBox and choose Visual Basic in the language combo. Click Space to see the Disassembler window, and choose each class (e.g. Album) in turn. At the bottom of the Disassembler window is a link "Expand Methods" - click this to see the converted code.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
Got it, with the help of Reflector. The online converter took this code
pen = new Pen { Brush = Brushes.Gray, Thickness = 2 };
and spit out
pen = New Pen()
conveniently leaving out the
pen.Brush = Brushes.Gray
pen.Thickness = 2and a couple other conversions that I had to fix that were similar. The converter could of done:
pen = New Pen() With {.Brush=Brushes.Gray, Thickness=2 }
but to play it safe because VS08 only supports that it just left it out.. Problem fixed!