Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Drag image position
posted

I am able to drag a legend within a XamDataChart. The problem is on subsequent drags the ghost image of the legend gets further away from the cursor. The cursor is in the right spot but the opaque legend is not after the first drag. How do you position the ghost image?

<Grid x:Name="LineGrid" Background="White">
<ig:XamDataChart x:Name="LineChart"
DefaultInteraction="DragZoom"
HorizontalZoomable="True"
HorizontalZoombarVisibility="Visible"
VerticalZoomable="True"
VerticalZoombarVisibility="Visible"
Legend="{Binding ElementName=LineLegend}"
PropertyChanged="OnPropertyChanged">
<ig:DragDropManager.DropTarget>
<ig:DropTarget IsDropTarget="True" DropChannels="ChannelLegend"/>
</ig:DragDropManager.DropTarget>
</ig:XamDataChart >
<ig:Legend x:Name="LineLegend"
Content="Legend"
HorizontalAlignment="Left"
Margin="10,10,0,0"
PreviewMouseDown="legend_MouseLeftButtonDown">
<ig:DragDropManager.DragSource>
<ig:DragSource IsDraggable="True" DragChannels="ChannelLegend" Drop="DragSource_Drop">
<ig:DragSource.MoveCursorTemplate>
<DataTemplate>
<Ellipse Fill="Green" Width="50" Height="50" />
</DataTemplate>
</ig:DragSource.MoveCursorTemplate>
</ig:DragSource>
</ig:DragDropManager.DragSource>
</ig:Legend>
</Grid>