Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created August 3, 2021 07:22
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 jasondown/705885f757dbb09e4af2460b72472346 to your computer and use it in GitHub Desktop.
Save jasondown/705885f757dbb09e4af2460b72472346 to your computer and use it in GitHub Desktop.
private bool _canPageNext;
/// <summary>
/// Gets or sets a value indicating whether move to the next page.
/// </summary>
/// <value>
/// <c>true</c> if you can move to the next page; otherwise, <c>false</c>.
/// </value>
public bool CanPageNext
{
get { return _canPageNext; }
set
{
if (_canPageNext != value)
{
_canPageNext = value;
OnPropertyChanged();
}
}
}
private ICommand _pageNextCommand;
/// <summary>
/// Gets the page next command.
/// </summary>
/// <value>
/// The page next command.
/// </value>
public ICommand PageNextCommand
{
get
{
return _pageNextCommand ??
(_pageNextCommand = new RelayCommand(PageNext, () => CanPageNext));
}
}
private void PageNext()
{
CurrentPage++;
PageableImages.Reset(GetImages());
CanPageNext = _images.Count > (CurrentPage + 1)*PageSize;
CanPagePrevious = true;
OnPropertyChanged("PageableImages");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment