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

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

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,676 questions
0 comments No comments
{count} votes

1 answer

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

    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.

    0 comments No comments