public MainPage()
        {
            InitializeComponent();
            SetupDataTemplates();

            listView.ItemTemplate = new PostTemplateSelector
            {
                ImageTemplate       = imageTemplate,
                UnsupportedTemplate = unsupportedTemplate
            };

            Items = new InfiniteScrollCollection <Models.Post>
            {
                OnLoadMore = async() =>
                {
                    var result = await PostDataService.GetPosts(25, After);

                    var items = result.Item1;
                    After = result.Item2;
                    return(items);
                }
            };

            Populate();
        }
        private async void Populate()
        {
            var result = await PostDataService.GetPosts(25, null);

            var items = result.Item1;

            After = result.Item2;

            Items.AddRange(items);
            listView.ItemsSource = Items;
            //listView.ItemsSource = await PostDataService.GetPosts(25);
        }
Exemple #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:System.Object" /> class.
 /// </summary>
 public PostDataServiceTest()
 {
     this.sessionFactory = new TestSessionFactory(this.DocumentStore);
     this.sut            = new PostDataService(new Mock <ILog>().Object, this.sessionFactory, this.DocumentStore);
 }
Exemple #4
0
 protected override async Task OnInitializedAsync()
 {
     Posts = (await PostDataService.GetAllPosts().ConfigureAwait(true)).ToList();
 }