Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using ParseJsonData.Models;
- using ParseJsonData.ViewModels;
- using System.Collections.ObjectModel;
- using Xamarin.Forms;
- namespace ParseJsonData.Views
- {
- public partial class SpacesXamlPage : ContentPage
- {
- private SpaceViewModel space_vm;
- public ObservableCollection<Post> Posts { get; set; }
- public SpacesXamlPage()
- {
- InitializeComponent();
- Posts = new ObservableCollection<Post>();
- space_vm = new SpaceViewModel();
- BindingContext = this;
- }
- protected override async void OnAppearing()
- {
- base.OnAppearing();
- try
- {
- var fetchedSpaces = await GetPostsAsync();
- if (fetchedSpaces !=null)
- {
- foreach(var space in fetchedSpaces)
- {
- Spaces.Add(space);
- }
- }
- }
- catch (Exception ex)
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement