Beispiel #1
0
        /// <summary>
        /// Async Method for show all chatrs
        /// </summary>
        private async void ShowCharts()
        {
            var model = new ViewCharts(); // init base url

            model.SetNewBaseUri();

            List <DataPointChart> dataList = new List <DataPointChart>();

            dataList = await ViewCharts.GetPointsData("total-bitcoins");

            if (dataList.Count > 0)
            {
                this.ciculationBTC.Content = CreateChart(dataList);
            }
            dataList = await ViewCharts.GetPointsData("market-price");

            if (dataList.Count > 0)
            {
                this.marketPriceUSD.Content = CreateChart(dataList);
            }
            dataList = await ViewCharts.GetPointsData("market-cap");

            if (dataList.Count > 0)
            {
                this.marketCapatalization.Content = CreateChart(dataList);
            }
            dataList = await ViewCharts.GetPointsData("trade-volume");

            if (dataList.Count > 0)
            {
                this.exchangeTradeVolume.Content = CreateChart(dataList);
            }
        }
Beispiel #2
0
        private async void ShowChartMarketPrice()
        {
            //var model = new ViewCharts();
            List <DataPointChart> dataList = new List <DataPointChart>();

            //model.DataFirstList = ViewCharts.GetPointsData("total-bitcoins");
            //model.DataSecondList = await ViewCharts.GetPointsData("market-price");
            dataList = await ViewCharts.GetPointsData("market-price");

            //model.DataThirdList = ViewCharts.GetPointsData("market-cap");
            //model.DataFourthList = ViewCharts.GetPointsData("trade-volume");

            this.marketPriceUSD.Content = CreateChart(dataList);
        }
Beispiel #3
0
        private async void ShowExchange()
        {
            var model     = new ViewCharts(); // init base url
            var srollview = new ScrollView();

            _tableGrid = new Grid();
            _tableGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            _tableGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            _tableGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            _tableGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            _tableGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            {// init Row
                List <string> strList = new List <string>
                {
                    "Curr.", "15m.", "Last", "Sell", "Buy"
                };
                GridRow(strList, Color.Black, 14, 0);
            }

            // download data from server
            List <DataTricker> dataList = new List <DataTricker>();

            dataList = await ViewCharts.GetMarketData();

            if (dataList.Count > 0) //test for count
            {
                for (int i = 0; i < dataList.Count; i++)
                {
                    List <string> marketList = new List <string>();
                    marketList.Add(dataList[i].NameCurrency);
                    marketList.Add(dataList[i].FifteenMinuts.ToString());
                    marketList.Add(dataList[i].Buy.ToString());
                    marketList.Add(dataList[i].Sell.ToString());
                    marketList.Add(dataList[i].Buy.ToString());

                    float result = i % 2;
                    if (result > 0)
                    {
                        GridRow(marketList, Color.Blue, 10, i + 1);
                    }
                    else
                    {
                        GridRow(marketList, Color.Gray, 10, i + 1);
                    }
                }


                srollview.Content      = _tableGrid;
                this.exchanger.Content = srollview;
            }
        }