private void EditPassword()
        {
            try
            {
                if (SelectedPassword == null)
                {
                    return;
                }

                try
                {
                    var dlg = new EditPasswordWindow(ds, SelectedPassword);
                    dlg.Owner = mainWindow;
                    dlg.ShowDialog();

                    if (!dlg.Cancelled)
                    {
                        LoadLists();
                    }
                }
                catch (Exception e)
                {
                    MessageBoxFactory.ShowError(e);
                }
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }
Example #2
0
        public EditPasswordWindowViewModel(EditPasswordWindow window, IDataStore ds, PasswordItem existing = null)
        {
            this.window = window;
            Cancelled   = true;

            isEdit  = existing != null;
            this.ds = ds;

            if (isEdit)
            {
                this.existing = existing;
                Name          = existing.Name;
                Username      = existing.Username;
                Password      = existing.Password;
            }
        }
        private void AddPassword()
        {
            try
            {
                var dlg = new EditPasswordWindow(ds);
                dlg.Owner = mainWindow;
                dlg.ShowDialog();

                if (!dlg.Cancelled)
                {
                    LoadLists();
                }
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }