wpf scrollintoview high cpu and freezing

24 views Asked by At

i have one problem.

using scrollintoview, select item in datagrid.(item count is about 100)

alomost is fine, but sometimes high cpu about 29%....

so i try this...

ScrollViewer.CanContentScroll="True" VirtualizingPanel.VirtualizationMode="Standard"

so it work for me. is remove cup high problem..

but sometimes take a long time scrollintoview about 1 ~ 5 second.. and freezing ui.(cpu is fine)

my source is below.

_revlist.SelectedIndex = nIdx;
Logger.d($"list Idx={nIdx}");
if (_revlist.SelectedItem != null)
{
    await _revlist.Dispatcher.BeginInvoke(new Action(() => _revlist.ScrollIntoView(_revlist.SelectedItem)));                
}
Logger.d("select ok."); `

what's problem? anyone let me know how to solve this problem..

0

There are 0 answers