public static LoginData ShowDialog(String title, String header, String info, String userNameText, String userName, ImageSource icon, SkinBundle bundle, Func <String, String, bool> validateUser) { LoginDialogEx dlg = new LoginDialogEx(validateUser, bundle) { Title = title, hInfo = { HeaderContent = header, DescriptionText = info } }; if (bundle != null) { bundle.SetBundle(dlg); } if (userNameText != null) { dlg.lblUserName.Content = userNameText; } dlg.txtUsername.Text = userName; if (icon != null) { dlg.Icon = icon; } if (dlg.ShowDialog().GetValueOrDefault(false)) { return(new LoginData(dlg.txtUsername.Text, dlg.txtPassword.Password)); } else { return(null); } }
public static LoginData ShowDialog(String title, String header, String info, String userNameText, String userName, ImageSource icon, SkinBundle bundle, Func<String, String, bool> validateUser) { LoginDialogEx dlg = new LoginDialogEx(validateUser, bundle) { Title = title, hInfo = { HeaderContent = header, DescriptionText = info } }; if (bundle != null) { bundle.SetBundle(dlg); } if (userNameText != null) dlg.lblUserName.Content = userNameText; dlg.txtUsername.Text = userName; if (icon != null) dlg.Icon = icon; if (dlg.ShowDialog().GetValueOrDefault(false)) return new LoginData(dlg.txtUsername.Text, dlg.txtPassword.Password); else return null; }