Performance delay occurs when creating new instance of my custom class on while loop

asked 2020-04-29T11:38:27.08+00:00
Magesh Sankar 36 Reputation points

I have one custom popup wpf control ( Repeater Items control), In the repeater control, every time when press up/down creating im creating new instance of item control added to repeater item collection.

My problem:

I have one progress bar and my custom repeater item control in my application.

Eg: When press up/down keys in my custom control, progress bar animation stops for few milliseconds. this delay when occurs due to , creating new instance of item control when press up/down keys.

Creating instance of certain class cause performance delay in my case.

Any suggestion on this.

Thanks

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,169 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2020-05-01T01:35:03.48+00:00
    Alex Li-MSFT 1,081 Reputation points

    Welcome to our Microsoft Q&A platform!

    You can use Task when creating new instance of my custom class on while loop

     Task.Run(() =>
                {
                  while loop
                });
    

    Thanks.

    No comments