public Task ShowAsync() { var commands = new List <IDialogUICommand <DialogResult> >(); _loginCommand = new DialogUICommand <DialogResult>("Login", DialogResult.Ok, true); _loginCommand.Invoked += async(sender, args) => { args.Cancel(); // Cancel command, we'll take it from here. await LoginAsync(); if (_authenticationService.IsLoggedIn) { args.DialogHost.TryClose(_loginCommand.DialogResult); } }; commands.Add(_loginCommand); #if !SILVERLIGHT var closeCommand = new DialogUICommand <DialogResult>("Close", DialogResult.Cancel, false, true); commands.Add(closeCommand); #endif UpdateCommands(); return(_dialogManager.ShowDialogAsync(commands, this)); }
public Task <DialogResult> ShowDialogAsync() { _okCommand = new DialogUICommand <DialogResult>(DialogResult.Ok, true) { Enabled = IsComplete }; var cancelCommand = new DialogUICommand <DialogResult>(DialogResult.Cancel, false, true); return(_dialogManager.ShowDialogAsync(new[] { _okCommand, cancelCommand }, this)); }
public Task<DialogResult> ShowDialogAsync() { _okCommand = new DialogUICommand<DialogResult>(DialogResult.Ok, true) {Enabled = IsComplete}; var cancelCommand = new DialogUICommand<DialogResult>(DialogResult.Cancel, false, true); return _dialogManager.ShowDialogAsync(new[] {_okCommand, cancelCommand}, this); }
public Task ShowAsync() { var commands = new List<IDialogUICommand<DialogResult>>(); _loginCommand = new DialogUICommand<DialogResult>("Login", DialogResult.Ok, true); _loginCommand.Invoked += async (sender, args) => { args.Cancel(); // Cancel command, we'll take it from here. await LoginAsync(); if (_authenticationService.IsLoggedIn) args.DialogHost.TryClose(_loginCommand.DialogResult); }; commands.Add(_loginCommand); #if !SILVERLIGHT var closeCommand = new DialogUICommand<DialogResult>("Close", DialogResult.Cancel, false, true); commands.Add(closeCommand); #endif UpdateCommands(); return _dialogManager.ShowDialogAsync(commands, this); }