protected override void CopyTransactionToFields()
        {
            base.CopyTransactionToFields();

            if (_Transaction != null)
            {
                TransactionType = ((CashTransaction)_Transaction).CashTransactionType;
                Amount          = ((CashTransaction)_Transaction).Amount;
            }
            else
            {
                TransactionType = CashTransactionType.Deposit;
                Amount          = 0.00m;
            }

            Stock = new StockViewItem(Guid.Empty, "", "");
        }
        private async void PopulateAvailableStocks(Date date)
        {
            if (_StockSelection == TransactionStockSelection.None)
            {
                return;
            }

            AvailableStocks.Clear();

            if (_StockSelection == TransactionStockSelection.Holdings)
            {
                var response = await _RestClient.Holdings.Get(date);

                var stocks = response.Select(x => new StockViewItem(x.Stock));
                foreach (var stock in stocks.OrderBy(x => x.FormattedCompanyName))
                {
                    AvailableStocks.Add(stock);
                }
            }
            else if (_StockSelection == TransactionStockSelection.TradeableHoldings)
            {
                var response = await _RestClient.Holdings.Get(date);

                var stocks = response.Select(x => new StockViewItem(x.Stock));
                foreach (var stock in stocks.OrderBy(x => x.FormattedCompanyName))
                {
                    AvailableStocks.Add(stock);
                }
            }
            else if (_StockSelection == TransactionStockSelection.Stocks)
            {
                var stocks = await _RestClient.Stocks.Get(date);

                foreach (var stock in stocks)
                {
                    var stockItem = new StockViewItem(stock.Id, stock.AsxCode, stock.Name);
                    AvailableStocks.Add(stockItem);
                    if (!stock.StapledSecurity)
                    {
                        foreach (var childSecurity in stock.ChildSecurities)
                        {
                            stockItem = new StockViewItem(stock.Id, childSecurity.AsxCode, childSecurity.Name);
                            AvailableStocks.Add(stockItem);
                        }
                    }
                }
            }
            else if (_StockSelection == TransactionStockSelection.TradeableStocks)
            {
                var response = await _RestClient.Stocks.Get(date);

                var stocks = response.Select(x => new StockViewItem(x.Id, x.AsxCode, x.Name));
                foreach (var stock in stocks.OrderBy(x => x.FormattedCompanyName))
                {
                    AvailableStocks.Add(stock);
                }
            }

            if (_Transaction != null)
            {
                Stock = AvailableStocks.FirstOrDefault(x => x.Id == _Transaction.Stock);
            }
        }