gong-wpf-dragdrop | DragDrop library is a drag'n'drop framework
kandi X-RAY | gong-wpf-dragdrop Summary
kandi X-RAY | gong-wpf-dragdrop Summary
The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gong-wpf-dragdrop
gong-wpf-dragdrop Key Features
gong-wpf-dragdrop Examples and Code Snippets
Community Discussions
Trending Discussions on gong-wpf-dragdrop
QUESTION
I have a .NET 5 project with following Nuget Packages:
- HandyControls for UI
- Gong-Wpf-DragDrop for Drag and Drop elements in a List
I have a XAML with a
ListBoxand a ViewModel with a
ObservableCollection` of Model.
The ObservableCollection
is binded as ItemSource
of ListBox
What I want to achieve:
When i Drag and Drop an item in a different position (or Add/Delete), I want the indexes to be refreshed.
Example:
Before Drag/Drop
After Drag/Drop
Actually, i binded the drophandler of gong-wpf-dragdrop and at the end of the drop, i manually refresh every single Index in my list.
there is a way to do it easily? because actually i have to refresh indexes manually.
Summarizing: When i reorder/delete/add items i want Model.Index of every item updated with the correct index position in ListBox.
My Mandate is:
- Show index (one based)
- Give the possibility to reorder the elements
I tried looking for similar questions but didn't find much that could help me. Thanks in advance :)
Model:
...ANSWER
Answered 2021-Sep-07 at 12:55I don't believe there is an out-of-the box way to bind to a container index in WPF. Your solution is actually easy to understand.
If you find yourself binding often to index, you could create your own attached property/value converter that internally climbs up the visual tree using these helpers until it finds the parent ItemsControl
and makes use of the IndexFromContainer
method.
Here is some code to get you started with this method:
First a small helper function to climb up the visual tree looking for an item of generic type:
QUESTION
I am using a Gong Framework in my project.
I've created the following DropHandler.
Xaml:
ANSWER
Answered 2020-Jan-02 at 12:25You can't implement the interface "again" in the same class but you could bind the DropHandler
property to an IDropTarget
property of the view model:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gong-wpf-dragdrop
How to...
Releases and Release Notes
Release History
Strong naming
Wiki
License
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page