Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight/Select dropped (custom way) ListBox item. 🔥 #492

Open
AlexandruFilipescuGuehring opened this issue Apr 2, 2024 · 0 comments
Labels

Comments

@AlexandruFilipescuGuehring
Copy link

AlexandruFilipescuGuehring commented Apr 2, 2024

Describe the bug
I have some trouble with selecting an ListBox item after it is dropped from a ListBox to a ListBox wrapped in a canvas.

       <ItemsPanelTemplate x:Key="CanvasItemsPanelTemplate">
           <Canvas ClipToBounds="True"/>
       </ItemsPanelTemplate> 

I noticed that if the property is placed in the XAML View like dd:DragDrop.SelectDroppedItems="True" and I remove the dd:DragDrop.DropHandler="{Binding}" it partially works. But the ListBox is not correctly positioned but selected. To correctly position a ListBox in my canvas I have a Drop() function that takes care of the positioning but doesn't select the item.

Couldn't I get the same behavior in my C# code as = dd:DragDrop.SelectDroppedItems="True" does in the XAML by adding it somewhere in my ViewModel, Drop() function? I think that there is some conflict with the custom functionality of the ListBox.

I have been stuck for days and I don't know what to do... Thanks for your time.

Expected behavior
I want an item to be directly highlighted with that blue border around it after it is dropped on the Canvas.

Desktop (please complete the following information):

  • OS: Windows
  • Version 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant