Esempio n. 1
0
        private void OnAddAccount()
        {
            EditAccountDlg addAcctDlg = new EditAccountDlg(true);

            addAcctDlg.Owner = Application.Current.MainWindow;
            AccountVM acct = new AccountVM();

            addAcctDlg.ViewModel = acct;
            bool?ret = addAcctDlg.ShowDialog();

            if (ret ?? false)
            {
                _accounts.Add(acct);
                //CheckCanExecute();

                Persist();
            }
        }
Esempio n. 2
0
        private void OnEditAccount(XamDataTree dataTree)
        {
            AccountVM acct = GetSelectedAcccount(dataTree);

            if (acct == null)
            {
                return;
            }

            EditAccountDlg addAcctDlg = new EditAccountDlg();

            addAcctDlg.Owner     = Application.Current.MainWindow;
            addAcctDlg.ViewModel = acct;
            bool?ret = addAcctDlg.ShowDialog();

            if (ret ?? false)
            {
                Persist();
            }
        }