public override void Login(LoginConfig config) {
     var dlg = new LoginContentDialog();
     var vm = new LoginViewModel {
         LoginText = config.OkText,
         Title = config.Title,
         Message = config.Message,
         UserName = config.LoginValue,
         UserNamePlaceholder = config.LoginPlaceholder,
         PasswordPlaceholder = config.PasswordPlaceholder,
         CancelText = config.CancelText
     };
     vm.Login = new Command(() =>
         config.OnResult?.Invoke(new LoginResult(vm.UserName, vm.Password, true))
     );
     vm.Cancel = new Command(() =>
         config.OnResult?.Invoke(new LoginResult(vm.UserName, vm.Password, false))
     );
     dlg.DataContext = vm;
     this.Dispatch(() => dlg.ShowAsync());
 }
 public override IDisposable Login(LoginConfig config)
 {
     var vm = new LoginViewModel
     {
         LoginText = config.OkText,
         Title = config.Title ?? String.Empty,
         Message = config.Message ?? String.Empty,
         UserName = config.LoginValue,
         UserNamePlaceholder = config.LoginPlaceholder,
         PasswordPlaceholder = config.PasswordPlaceholder,
         CancelText = config.CancelText
     };
     vm.Login = new Command(() =>
         config.OnAction?.Invoke(new LoginResult(true, vm.UserName, vm.Password))
     );
     vm.Cancel = new Command(() =>
         config.OnAction?.Invoke(new LoginResult(false, vm.UserName, vm.Password))
     );
     var dlg = new LoginContentDialog
     {
         DataContext = vm
     };
     return this.DispatchAndDispose(
         () => dlg.ShowAsync(),
         dlg.Hide
     );
 }