public LogonCreds GetLogin(Exception showReason) { var model = new LogonModel(); logonFormCompleteEvent.Reset(); ShowLogonFormModal(model); logonFormCompleteEvent.WaitOne(); return new LogonCreds() { Name = model.Login, Psw = model.Password, IsCanceled = !model.IsOk, IsSuccessful = model.IsOk }; }
/// <summary> /// delegate to launch in the main application thread /// </summary> private void _showLogonFormModal(LogonModel model) { LogonView view = new LogonView(logonFormCompleteEvent); view.AttachModel(model); _regionManager.Regions["ModalRegion"].Add(view); }
public void ShowLogonFormModal(LogonModel model) { Application.Current.Dispatcher.BeginInvoke(new Action(() => { _showLogonFormModal(model); }), DispatcherPriority.Background); }
public void AttachModel(LogonModel model) { this.DataContext = model; }