Hello,
I'm using a custom DragVisualProvider with the ListBoxDragDropBehavior and I can't seem to figure out how to offset the mouse position within the dragVisual. I know you can get the RelativeStartPoint from DragVisualProviderState, but how do you set that on the newly created dragVisual (ContentControl, in this case).
Here is my custom DragVisualProvider code:
Thanks in advance
I'm using a custom DragVisualProvider with the ListBoxDragDropBehavior and I can't seem to figure out how to offset the mouse position within the dragVisual. I know you can get the RelativeStartPoint from DragVisualProviderState, but how do you set that on the newly created dragVisual (ContentControl, in this case).
Here is my custom DragVisualProvider code:
public
FrameworkElement CreateDragVisual(DragVisualProviderState state)
{
var visual =
new
ContentControl();
var theme = StyleManager.GetTheme(state.Host);
if
(theme !=
null
)
{
StyleManager.SetTheme(visual, theme);
}
var draggedItem = state.DraggedItemContainers.First()
as
FrameworkElement;
visual.Height = draggedItem.ActualHeight;
visual.Width = draggedItem.ActualWidth;
visual.Content = state.DraggedItems.OfType<
object
>().FirstOrDefault();
visual.ContentTemplate =
this
.DragVisualTemplate;
return
visual;
}
Thanks in advance