Mike - Regardless of where it came from, what you describe and subsequently
posted code for is not drag and drop.
Your code just runs a watered-down version of the INSERT command when the
user clicks a list item. So in otherwords, what you charcterize as a
'workaround' [for broken WPF drag and drop], amounts to not supporting drag
and drop at all.
That's no workaround. The workaround is to use the WinForms version of the
DoDragDrop() method as I mentioned earlier. I'm not sure where you got the
idea that there's some cost to referencing System.Windows.Forms.dll, because
AutoCAD loads and uses it anyway, so it's free.
Of course, you're free to use whatever approach you wish, but the point to
my comment is that what you posted for the OP is not a workaround that
allows them to use drag and drop.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message
news:6308388@discussion.autodesk.com...
Yes. Here is what I received - it differs from the posted example because my
project drops a class object which contains metadata [site location to
download the block, part data to write in as xrecord, etc.] I tweaked the
example to use just the string but you can see I followed the same logic
supplied here:
Quote:
When you addd the ListboxItem - be it a icon or text, at that point set the
Tag = MyClass
MyClass
{
string URL;
string partNumber;
}
In your StartDrag e.SOurce = listboxitem that is dragged, retrieve Tag into
MyClass
MyClass = e.Source.Tag
sendStringToExecute("mycommand www.ttt.co, partno");
MyCommand
Getstring(URL)
GetString(Partno);
StartJig
:End Quote
Obviously, I would prefer a true drag-n-drop solution but I did not have the
time to pursue it further and, honestly, trying to supply a converter
between the two types is beyond my comfort level. Albert liked this better
than a couple other ideas I had because in my case, the user could hit enter
to repeat the insert process "...just like a native command". The data-idata
has been logged as a defect and will be corrected at some point.