예제 #1
0
        private static AccountSectionHeader BundleAccount(string caption, ObservableCollection <AccountViewModel> output, IEnumerable <Account> accountOfTypeBanking)
        {
            AccountSectionHeader sectionHeader = new AccountSectionHeader();

            if (accountOfTypeBanking.Count() > 0)
            {
                sectionHeader.Title = caption;

                List <Account> bundle = new List <Account>();
                sectionHeader.Accounts = bundle;

                output.Add(sectionHeader);

                foreach (Account a in accountOfTypeBanking)
                {
                    output.Add(new AccountItemViewModel(a));
                    bundle.Add(a);
                }

                sectionHeader.UpdateBalance();
            }
            return(sectionHeader);
        }