How to show WPF controls during run script
Hello!
I wrote following code
foreach(var item in names) { var button = new System.Windows.Controls.Button { Content = item }; button.Click += (sender, args) => button.Content = "I've just been clicked!"; PanelManager.StackWpfElement(button); while( ...smth... ) Thread.Sleep(100); }
I wait for that code show button and wait my click to continue, but show nothing. if I remove while with sleep then I show all buttons at once. How to show WPF controls during run script?
Comments
Replace the call to Thread.Sleep with:
Another option, if you need just a simple button and not a WPF button, is to use LINQPad's HTML controls, i.e., LINQPad.Controls.Button: