コード例 #1
0
        public MainPage()
        {
            InitializeComponent();
            var client = new AppHttpClient();

            Task.Factory.StartNew(new Action(() =>
            {
                var fetchMatchesTask = client.GetMatchesAsync();
                fetchMatchesTask.Wait();
                matches = JsonMatchDeserializer.GetMatchObservableCollectionFromJsonString(fetchMatchesTask.Result);
                PopulateMatchItemsControl(matches);
            }));
        }
コード例 #2
0
        public async Task<MatchData> GetMatchDataAsync()
        {
            if (MatchData != null)
                return MatchData;

            var client = new AppHttpClient();

            var dataString = await client.GetMatchDataAsync(GetMatchId());
            MatchData = JsonMatchDeserializer.GetMatchDataFromJsonString(dataString);

            return MatchData;
        }