Exemplo n.º 1
0
        private void UpdateOtherComboBox()
        {
            var tempCollection = new ObservableCollection <AccountViewModel>(ChargedAccounts);

            foreach (var account in TargetAccounts)
            {
                if (!tempCollection.Contains(account))
                {
                    tempCollection.Add(account);
                }
            }
            foreach (var account in tempCollection)
            {
                //fills targetaccounts
                if (!TargetAccounts.Contains(account))
                {
                    TargetAccounts.Add(account);
                }

                //fills chargedaccounts
                if (!ChargedAccounts.Contains(account))
                {
                    ChargedAccounts.Add(account);
                }
            }
            ChargedAccounts.Remove(selectedPayment.TargetAccount);
            TargetAccounts.Remove(selectedPayment.ChargedAccount);
        }
Exemplo n.º 2
0
        private void UpdateOtherComboBox()
        {
            ObservableCollection <Account> tempCollection = new ObservableCollection <Account>(ChargedAccounts);

            foreach (Account i in TargetAccounts)
            {
                if (!tempCollection.Contains(i))
                {
                    tempCollection.Add(i);
                }
            }
            foreach (Account i in tempCollection)
            {
                if (!TargetAccounts.Contains(i))//fills targetaccounts
                {
                    TargetAccounts.Add(i);
                }

                if (!ChargedAccounts.Contains(i))//fills chargedaccounts
                {
                    ChargedAccounts.Add(i);
                }
            }
            ChargedAccounts.Remove(selectedPayment.TargetAccount);
            TargetAccounts.Remove(selectedPayment.ChargedAccount);
        }