Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
XamarinMobileAppsDemo/Xamarin_MobileApps_STD/MainPage.xaml.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (33 sloc)
925 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
using Xamarin_MobileApps_Demo.ViewModels; | |
namespace Xamarin_MobileApps_Demo | |
{ | |
public partial class MainPage : ContentPage | |
{ | |
MainPageViewModel model; | |
public MainPage() | |
{ | |
InitializeComponent(); | |
model = MainPageViewModel.Instance; | |
this.BindingContext = model; | |
} | |
protected async override void OnAppearing() | |
{ | |
await model.LoadDataAsync(); | |
base.OnAppearing(); | |
} | |
protected async void ListView_ItemsAppearing(object sender, ItemVisibilityEventArgs e) | |
{ | |
var itemTypeObject = e.Item as Product; | |
if (model.Items.Last() == itemTypeObject) | |
{ | |
await model.LoadDataAsync(); | |
} | |
} | |
} | |
} |