Exemple #1
0
        private async void deletePinMenu_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new PinSimpleDialog(I18NStringUtil.GetString("uv_old_pin"));

            if (dialog.ShowDialog() == true)
            {
                await ViewModel.ChangePin.Execute((dialog.Result, ""));
            }
        }
Exemple #2
0
        private async void editPinMenu_Click(object sender, RoutedEventArgs e)
        {
            var oldPinDialog = new PinSimpleDialog(I18NStringUtil.GetString("uv_old_pin"));
            var newPinDialog = new PinSimpleDialog(I18NStringUtil.GetString("uv_set_new_pin"));

            if (oldPinDialog.ShowDialog() == true && newPinDialog.ShowDialog() == true)
            {
                await ViewModel.ChangePin.Execute((oldPinDialog.Result, newPinDialog.Result));
            }
        }
Exemple #3
0
        private async void showPasswordBtn_Click(object sender, RoutedEventArgs e)
        {
            string pin = "";

            if (!ViewModel.IsPasswordShown && ViewModel.HasPin)
            {
                var dialog = new PinSimpleDialog(I18NStringUtil.GetString("uv_input_pin_for_pwd"));

                if (dialog.ShowDialog() == true)
                {
                    pin = dialog.Result;
                }
                else
                {
                    return;
                }
            }

            await ViewModel.TogglePasswordShown.Execute(pin);
        }
Exemple #4
0
        private async void editPasswordMenu_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new LoginWindow(ViewModel.User.Username, false);

            dialog.Message = I18NStringUtil.GetString("uv_reset_password");
            if (dialog.ShowDialog() == true)
            {
                var res = MessageBox.Show(I18NStringUtil.GetString("uv_reset_password_pin"),
                                          I18NStringUtil.GetString("warning"), MessageBoxButton.YesNo, MessageBoxImage.Question);
                var pin = "";
                if (res == MessageBoxResult.Yes)
                {
                    var pinD = new PinSimpleDialog(I18NStringUtil.GetString("uv_set_new_pin"));
                    if (pinD.ShowDialog() == true)
                    {
                        pin = pinD.Result;
                    }
                }

                await ViewModel.ChangePassword.Execute((dialog.Result.Password, pin));
            }
        }
Exemple #5
0
        private void newUserButton_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new LoginWindow();

            dialog.ShowDialog();

            if (dialog.DialogResult == true)
            {
                string pin = "";

                var isPinNeeded = MessageBox.Show(I18NStringUtil.GetString("um_pin_hint"), I18NStringUtil.GetString("warning"), MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (isPinNeeded == MessageBoxResult.Yes)
                {
                    var dialogPin = new PinSimpleDialog();
                    if (dialogPin.ShowDialog() == true)
                    {
                        pin = dialogPin.Result;
                    }
                }

                ViewModel.AddUser.Execute((dialog.Result, pin)).Subscribe();
            }
        }