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

Performance issues when dragging an item in a ListView #158

Closed
OronDF343 opened this issue Dec 31, 2015 · 4 comments
Closed

Performance issues when dragging an item in a ListView #158

OronDF343 opened this issue Dec 31, 2015 · 4 comments
Assignees
Milestone

Comments

@OronDF343
Copy link

Tested on both 0.1.4.3 and 1.0.0-ALPHA012
Dragging an item in the ListView causes low frame rate in the UI due to high CPU usage.
Using the diagnostic tools and dragging an item up and down, I found that GongSolutions.Wpf.DragDrop.DragDrop.DragSource_PreviewMouseMove was called over 3000 times, and almost every time (all except for 2) it calls System.Windows.DragDrop.DoDragDrop which causes all of the CPU usage.
Here is the code of the ListView: (Note: changing the SelectionMode doesn't make a difference)

<ListView Grid.Row="2"
          ItemsSource="{Binding PlaylistManager.SelectedPlaylist}"
          SelectionMode="Multiple"
          dragDrop:DragDrop.IsDragSource="True"
          dragDrop:DragDrop.IsDropTarget="True">
    <ListView.View>
        <GridView>
            <GridViewColumn DisplayMemberBinding="{Binding Tag.Title}" Header="Title"/>
            <GridViewColumn DisplayMemberBinding="{Binding Tag.JoinedPerformers}" Header="Performers"/>
            <GridViewColumn DisplayMemberBinding="{Binding FileName}" Header="File name"/>
            <GridViewColumn DisplayMemberBinding="{Binding Bitrate}" Header="Bitrate"/>
            <GridViewColumn DisplayMemberBinding="{Binding Duration}" Header="Duration"/>
        </GridView>
    </ListView.View>
</ListView>
@OronDF343
Copy link
Author

Anyone taken a look at this? System.Windows.DragDrop.DoDragDrop should not be called on every MouseMove...

@punker76
Copy link
Owner

@OronDF343 You're not right, this line is only called once (just create a break point with some message and continue execution)

var result = System.Windows.DragDrop.DoDragDrop(m_DragInfo.VisualSource, data, m_DragInfo.Effects);

@OronDF343
Copy link
Author

@punker76 You're right, it is only called once (back then I had used a bad profiler)
However, the performance issues still exist, and they happen only when I move the mouse over a different item in the ListView. I can't seem to figure out what's causing it.

@punker76 punker76 added this to the v1.0.0 milestone Aug 2, 2016
@punker76 punker76 self-assigned this Aug 2, 2016
@punker76
Copy link
Owner

punker76 commented Aug 2, 2016

@OronDF343 This performance issue should be fixed now

@punker76 punker76 closed this as completed Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants