private void onOK()
{
var pin = Windows.GetText(tbPINCode).Trim();
var errorMessage = String.Empty;
var hasValidPin = CheckPINCode(pin, Windows.GetText(svalMaxDigit)[0], ref errorMessage);
if (hasValidPin == false)
{
DialogUtils.ShowTimedDialog(this, errorMessage);
return;
}
if (DialogUtils.Confirm(this, string.Format(Resources.YourNewPINIs0NsaveChanges, pin)))
{
var prefs = updateSettingsFromUI();
if (prefs != null)
{
prefs.Save();
}
_isDirty = false;
Common.AppPreferences.NotifyPreferencesChanged();
}
Windows.CloseForm(this);
}