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
845
Dragged item from list is too small during the drag operation
posted

I have the following definition for a drag source:

            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <ig:DragDropManager.DragSource>
                    <ig:DragSource IsDraggable="True"
                                   DragChannels="ChannelA"
                                   Drop="DragSource_Drop"
                                   DragStart="DragSource_DragStart">
                    </ig:DragSource>
                </ig:DragDropManager.DragSource>
                <TextBlock Text="Barcode" />
                <TextBlock Text="Price" />
                <TextBlock Text="Description" />
                <TextBlock Text="Sale Price" />
                <TextBlock Text="Extended Description" />
            </StackPanel>

When I drag the text "Extended Description" the cursor looks like this:

Correct size

When I drag the text "Sale Price", however, the cursor looks like this:

Too small

How can I get the text to be the correct size? I've looked for a transformation I can set/reset but there doesn't appear to be one.

If all the items in the panel are approximately the same size the issue is still there, but less noticeable. However, in the real system the items to be dragged will be the range of lengths shown here.

Parents
No Data
Reply
  • 845
    Verified Answer
    Offline posted

    Great, 5 minutes after I post this I find a solution.

    By changing the TextBlock definitions to be:

                    <TextBlock Text="Barcode" HorizontalAlignment="Left"/>
                    <TextBlock Text="Price" HorizontalAlignment="Left"/>
                    <TextBlock Text="Description" HorizontalAlignment="Left"/>
                    <TextBlock Text="Sale Price" HorizontalAlignment="Left"/>
                    <TextBlock Text="Extended Description" HorizontalAlignment="Left"/>

    i.e. explicitly setting the horizontal alignment it cures the problem.

Children
No Data