Since you want to force the operation to not continue until this is complete, I would suggest making a method to handle loading and displaying your progress.
You could use a separate property to disable the UI while this loads, which could effectively "block" your user until the operation completes:
public string MyPath
{
get { return _mypath; }
set
{
_myPath = value;
NotifyPropertyChanged(() => MyPath);
UpdateMyPathAsync();
}
}
public async Task UpdateMyPathAsync()
{
this.EnableUI = false; // Stop user from setting path again....
await LoadSomeStuffFromMyPathAsync(MyPath);
this.EnableUI = true;
}
This allows you to still bind, as normal, with WPF, but have your UI reflect that the operation is running (asynchronously) and display progress, etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…