Exemple #1
0
        private async void OnPriceChanged()
        {
            Price price = Price;

            if (price == null)
            {
                Content = null;
                return;
            }

            if (price.Currency != currency?.UniqueCode)
            {
                currency = currencyProvider.Get(price.Currency);
                string symbol = await queryDispatcher.QueryAsync(new GetCurrencySymbol(price.Currency));

                if (symbol != currency.Symbol)
                {
                    currency = currency.ForCustomSymbol(symbol);
                }
            }

            Content = new TextBlock()
            {
                Text       = currency.Format(price.Value),
                FontSize   = FontSize,
                Foreground = Foreground,
            };
        }