A quick question before the new year..
I have a button on Dockpane that runs a few geoprocessing tools that takes some time.
I added a label to the dockpane and I would like to send messages as the process move forwards (just like in the gp results window).
After each step I use:
_message = "Mody";
NotifyPropertyChanged(() => message);
but the dockpane update only when all the process ends.
Putting a MessageBox after each change makes the dockpane update but it is blocking the process - that is what I try to avoid.
I could not find any way to refresh/sync the dockpane to get the messages while the process continue.
Happy new year
Mody
Hi,
Have you tried this (best-way-to-show-progress) using Dispatcher?
The code below works for me...
private async Task DoSend()
{
await QueuedTask.Run(() => {
_message = "first message";
NotifyPropertyChanged("message");
System.Threading.Thread.Sleep(1500);
// do something....
_message = "second message";
NotifyPropertyChanged("message");
});
}