How to block UI in Caliburn.Micro
?
public async void AcceptButton()
{
await this.httpDataService.Register(account);
Show.SuccesBox(alert);
this.TryClose();
}
How to wait for end of Task
in my ViewModel
by blocking View
?
EDIT
i added binding on my button in xaml
:
IsEnabled="{Binding isEnabled}"
Then, my VM
:
bool isEnabled {get;set;}
public async void AcceptButton()
{
this.isEnabled = false;
await this.httpDataService.Register(account);
Show.SuccesBox(alert);
this.TryClose();
}
In this case, AcceptButton
is always unactive IsEnabled=false
. How to trigger false
only on button click?