Example #1
0
 public SendMoney(Wallet wallet, WalletPage parentPage)
 {
     InitializeComponent();
     fromWallet          = wallet;
     parent              = parentPage;
     WalletMoney.Content = $"{wallet.Amount:C0}";
 }
        public History(IEnumerable <HistoryData> data, WalletPage parentPage)
        {
            InitializeComponent();
            var dataAsList = data as IList <HistoryData> ?? data.ToList();

            foreach (var historyData in dataAsList)
            {
                historyData.Username = Server.GetAccountData(historyData.Username).AccountName;
            }
            dataAsList.Add(new HistoryData {
                Username = "******", Amount = dataAsList.Sum(x => x.Amount), DateTime = DateTime.Now.ToLongDateString()
            });
            HistoryTable.ItemsSource = dataAsList.Reverse();
            walletPage = parentPage;
        }
        public AddUsersPage(Wallet parentWallet, WalletPage walletPage)
        {
            InitializeComponent();
            wallet            = parentWallet;
            this.parentWallet = walletPage;
            Lister.AddNode(Homepage.Instance.Account, Homepage.Instance.Account.AccountName, false);

            foreach (var walletUserData in Server.GetUsersOfWallet(wallet.Guid))
            {
                if (walletUserData.UserName == Homepage.Instance.Account.UserName)
                {
                    continue;
                }

                var user = Server.GetAccountData(walletUserData.UserName);
                Lister.AddNode(user, user.AccountName);
            }
        }