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
1314
Drag Drop icon
posted

Hi,

Is there anyway to change the location of the icon (x or hand) that is displayed so that it does not overlap the dragged item text? Say move to left or right edge.

Thanks

  • 8831
    Verified Answer
    posted

    First of all please excuse me for the delay. The answer is that it’s possible when you are using data template applied to DragSource.DragTemplate.  You need to set RenderTransform with desired offset for the root element of your data template.

    <!-- dragTemplateDragStart -->

    <DataTemplate x:Key="dragTemplateDragStart">

          <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="1"

                  Padding="6 10 6 10">

     

                <Border.RenderTransform>

                      <TranslateTransform X="-40" Y="-40"/>

                </Border.RenderTransform>

     

    <Image Source="{Binding Path=DragImage.Source}"/>

          </Border>

    </DataTemplate>

     

    I hope that will help.

    Best regards.

    PPilev.