Drag and Drop
Drag and Drop
Hello,
Do you have a sample of how to implement drag and drop with two thumbnail viewers? I would like to be able to move a tif page from one thumbnail viewer to another thumbnail viewer, but the DragDrop event does not want to fire.
Sample in VB.NET or C# please.
Thanks,
Dan
Do you have a sample of how to implement drag and drop with two thumbnail viewers? I would like to be able to move a tif page from one thumbnail viewer to another thumbnail viewer, but the DragDrop event does not want to fire.
Sample in VB.NET or C# please.
Thanks,
Dan
Re: Drag and Drop
Hello,
You will find C# & vb.NET samples in our latest package. Just search for "Thumbnail - Drag And Drop" demo project.
Let me know if you don't find it.
Regards,
Loïc
You will find C# & vb.NET samples in our latest package. Just search for "Thumbnail - Drag And Drop" demo project.
Let me know if you don't find it.
Regards,
Loïc
Re: Drag and Drop
I'm not seeing it. I'm looking in C:\Program Files (x86)\GdPicture.NET 9\samples\AnyCPU ??
Should I be looking somewhere else?
Should I be looking somewhere else?
Re: Drag and Drop
Nevermind. Got it, I had an earlier version. Thanks!
Re: Drag and Drop
Hello,
Couple questions:
1) How can I get the DragDrop event to fire when the OwnDrop property is set to false. The autoscrolling stops working when OwnDrop is true.
2) Is there functionality with the thumbnail viewer to show the user where the thumbnail will be dropped? I.E. when they hover ahead or behind an image a line could appear indicating that is where the image will be placed.
Thanks,
Dan
Couple questions:
1) How can I get the DragDrop event to fire when the OwnDrop property is set to false. The autoscrolling stops working when OwnDrop is true.
2) Is there functionality with the thumbnail viewer to show the user where the thumbnail will be dropped? I.E. when they hover ahead or behind an image a line could appear indicating that is where the image will be placed.
Thanks,
Dan
Last edited by dvonfeldt on Thu Oct 04, 2012 12:32 am, edited 1 time in total.
Re: Drag and Drop
Hello,
Kind regards,
Loïc
This is not possible. When OwnDrop property is set to false, DragDrog is never fired for internal usage. That said, I don't understand what you meant by "autoscrolling stops working when ", could you clarify?1) How can I get the DragDrop event to fire when the OwnDrop property is set to false. The autoscrolling stops working when OwnDrop is false.
Unfortunately not yet. The appearance should be improved in future release.2) Is there functionality with the thumbnail viewer to show the user where the thumbnail will be dropped?
Kind regards,
Loïc
Re: Drag and Drop
Thank you for the reply. What I mean by auto scrolling is the following: If I have a large amount of images in a thumbnail viewer and I am attempting to move an image from the bottom of the list to the top and it would require scrolling, the viewer does not auto scroll when I hover my cursor near the top of the viewer. This functionality does occur if I have OwnDrop = False, however if I set the OwnDrop to false then I lose my drag an drop between thumb viewers.
Re: Drag and Drop
Hello,
Therefore, it is not possible to use the autoscroll when the OwnDrop is true.
Hope this clarify.
Kind regards,
Loïc
The autoscroll feature behaves only when AllowMoveItems is set to true. And AllowMoveItems is automatically set to False when OwnDrop is set to true.the viewer does not auto scroll when I hover my cursor near the top of the viewer
Therefore, it is not possible to use the autoscroll when the OwnDrop is true.
Hope this clarify.
Kind regards,
Loïc
Re: Drag and Drop
You will find C# & vb.NET samples in our latest package. Just search for "Thumbnail - Drag And Drop" demo project. It is working as expected in C# demo project but not working on WPF demo sample.
You need to handle the "Manipulation" events and "Touch" events when developing your application.
I have faced the same issue and able to scroll with the following code,
private void ExtractScrollViewerFromVSTree(DependencyObject element, double pagePosition)
{
try
{
int totalElementcount = VisualTreeHelper.GetChildrenCount(element);
for (int counter = 0; counter < totalElementcount; counter++)
{
DependencyObject eleDependencyObject = VisualTreeHelper.GetChild(element, counter);
if (eleDependencyObject.GetType().Name == "ScrollViewer")
{
ScrollViewer scrollViewer = eleDependencyObject as ScrollViewer;
if (pagePosition > 'YourAssumption') // for me it is 610
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + 45);
}
else if (pagePosition < 'YourAssumption') //for me it is 40
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - 45);
}
break;
}
ExtractScrollViewerFromVSTree(VisualTreeHelper.GetChild(element, counter), pagePosition);
}
}
catch(Exception ex)
{
}
}
In the above method, you need to pass ThumbnailEx object as an input and the dragposition of page. It is a recursive method to get the scrollviewer control inside the thumbnail control with the help of visual tree.
Let me know if you need further help.
You need to handle the "Manipulation" events and "Touch" events when developing your application.
I have faced the same issue and able to scroll with the following code,
private void ExtractScrollViewerFromVSTree(DependencyObject element, double pagePosition)
{
try
{
int totalElementcount = VisualTreeHelper.GetChildrenCount(element);
for (int counter = 0; counter < totalElementcount; counter++)
{
DependencyObject eleDependencyObject = VisualTreeHelper.GetChild(element, counter);
if (eleDependencyObject.GetType().Name == "ScrollViewer")
{
ScrollViewer scrollViewer = eleDependencyObject as ScrollViewer;
if (pagePosition > 'YourAssumption') // for me it is 610
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + 45);
}
else if (pagePosition < 'YourAssumption') //for me it is 40
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - 45);
}
break;
}
ExtractScrollViewerFromVSTree(VisualTreeHelper.GetChild(element, counter), pagePosition);
}
}
catch(Exception ex)
{
}
}
In the above method, you need to pass ThumbnailEx object as an input and the dragposition of page. It is a recursive method to get the scrollviewer control inside the thumbnail control with the help of visual tree.
Let me know if you need further help.
Who is online
Users browsing this forum: No registered users and 1 guest