コード例 #1
0
        // Instance method to add and retrieve our  Walk Trail items
        public async Task GetWalkTrailItems()
        {
            // Check our IsProcessBusy property to see if we are already processing
            if (IsProcessBusy)
            {
                return;
            }

            // If we aren't processing, we need to set our IsProcessBusy property to true
            IsProcessBusy = true;

            // Populate our WalkListModel List Collection with items from our Microsoft Azure Web Service
            WalksListModel = new ObservableCollection <WalkDataModel>(await AzureDatabase.GetWalkEntries());

            // Set our IsProcessBusy property value back to false when finished
            IsProcessBusy = false;
        }
コード例 #2
0
        public async Task GetWalkTrailItems()
        {
            if (IsProcessBusy)
            {
                return;
            }

            IsProcessBusy = true;

            /* hard coded data
             * WalksListModel = new ObservableCollection<WalkDataModel>
             * {
             *      new WalkDataModel
             *      {
             *              Id = 1,
             *              Title = "10 Mile Brook Trail, Margaret River",
             *              Description = "The 10 Mile Brook Trail starts in the Rotary Park near old Kate, a preserved steam engine at the northen edge of Margaret River.",
             *              Latitude = -33.9727604,
             *              Longitude = 115.0861599,
             *              Distance = 7.5,
             *              Difficulty = "Medium",
             *              ImageUrl = "http://trailswa.com.au/media/cache/media/images/trails/_mid/FullSizeRender1_600_480_c1.jpg"
             *      },
             *      new WalkDataModel
             *      {
             *              Id = 2,
             *              Title = "Ancient Empire Walk, Valley of the Ancients",
             *              Description = "The Ancient Empire is a 450 metre walk trail that takes you around and through some of the giant tingle trees including the most popular of the gnarled  veterans, known as Grandma Tingle",
             *              Latitude = -34.9749188,
             *              Longitude = 117.3560796,
             *              Distance = 450,
             *              Difficulty = "Hard",
             *              ImageUrl = "http://trailswa.com.au/media/cache/media/images/trails/_mid/Ancient_Empire_534_480_c1.jpg"
             *      }
             * };
             */
            WalksListModel = new ObservableCollection <WalkDataModel>(await AzureDatabase.GetWalkEntries());

            await Task.Delay(3000);             // temp timer for demoing

            IsProcessBusy = false;
        }