I'm solving a lot of issues thanks to you, and learning many thinks.
But I was wondering if the variable IsBusy, that binding property all we use to notify the user that a background task is taking place, should be a boolean as I see in all codes, or an integer.
I'm worry about the fact that we set it from independent threads, and if they work as they teached me, if I call some commands with this structure:
IsBusy = true; MyCommand.ChangeCanExecute(); data = await GetData(); IsBusy = false; MyCommand.ChangeCanExecute();
the first thread that ends will put "IsBusy" to false, while the others are still working, isn't it?
So it has sense to set IsBusy as an int, increment it when a new task is called, and decrement it if the task ends, and use a Converter to return true id IsBusy > 0.
Am I right, or did I miss something? What do you think?