Hi,I try to add a UserControl to DragSnapshotElement but nothing is visible. Do i something wrong?
Handler:
AddHandler source.DragStart, Sub(s As Object, e As DragDropStartEventArgs) Dim dragger As New Dragger e.DragSnapshotElement = dragger End Sub
UserControl:
<UserControl x:Class="WorkflowBrowser.Dragger" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" Width="200" Height="200"> <Grid x:Name="LayoutRoot" Background="Blue"> </Grid> </UserControl>
The Textblock example from documentation works fine. I'm using v11.2.
Many thanks,
Tobias
Hi,
I suppose you need to call dragger.Measure() before do that, since it's not a part of the visual tree. Also your DragSnapshotElement will be ignored if you have applied a DragSource.DragTemplate.
Best regards.Plamen.
Calling Dragger.Measure don't change the result.
AddHandler source.DragStart, Sub(s1 As Object, e1 As DragDropStartEventArgs) Dim dragger As New Dragger dragger.Measure(Application.Current.RootVisual.RenderSize()) e1.DragSnapshotElement = dragger End Sub
I'm going to try a DragTemplate. Maybe this works:-)
The DragTemplate will not work for me. Any help for using the DragSnapShotElement is appreciated.
Kind Regards,Tobi
Hello Tobbi,
Thank you or your patience while our Development Team was reviewing the behavior that you have described. After investigating it, it turns out that in order for the element set to the DragSnapshotElement property, to be displayed, while dragging an item, the value of the DragSnapshotElement property should be an element that is part of the visual tree. The reason for that is, in Silverlight platform, in order to draw an image of an element, it should be part of the visual tree of the application.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello Tobi,
I have logged this behavior with our developers in our tracking system, with an issue ID of 111735. I have also created a support ticket on your behalf with number CAS-91166-48F0JN in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Infragistics, Inc.