Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Last active December 6, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/7df81ad1b015a9c13fcefee19baddbca to your computer and use it in GitHub Desktop.
Save icebeam7/7df81ad1b015a9c13fcefee19baddbca to your computer and use it in GitHub Desktop.
XamarinAdventCalendarApp: PublicationViewModel.cs (Refresh code)
public class PublicationViewModel : BaseViewModel
{
// properties and commands - code omitted
private bool _isRefreshing;
public bool IsRefreshing
{
get => _isRefreshing;
set { _isRefreshing = value; OnPropertyChanged(); }
}
public ICommand RefreshCommand { private set; get; }
public PublicationViewModel()
{
//.. constructor - code omitted
RefreshCommand = new Command(async () => await LoadPublications());
}
// methods - code omitted
async Task LoadPublications()
{
// code omitted
IsRefreshing = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment