简体   繁体   中英

Dynamically create controls in thread in WPF

In my WPF form i have button Control when i click that button Dynamically tabcontroll is added in the form inside that tab control one page is there. On that page many data are there .so the tabcontrol take time to load in the form.

I want to show the tab control first then i want to add the page in the tab. Is it Possible with the help of background worker or any other thread.

The problem is that UI elements have to be created on the UI thread. So you cannot create those elements in a different thread, such as in a BackgroundWorker.

If getting the data is the slow part, you could use PriorityBindings .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM