question

MageshSankar-9134 avatar image
0 Votes"
MageshSankar-9134 asked ·

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

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-wpf
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlexLi-MSFT avatar image
0 Votes"
AlexLi-MSFT answered ·

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.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.