Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created December 23, 2019 20:37
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 jfversluis/8be3c0f196faa9ccf3b8ab9f815c8917 to your computer and use it in GitHub Desktop.
Save jfversluis/8be3c0f196faa9ccf3b8ab9f815c8917 to your computer and use it in GitHub Desktop.
public class FavFightersViewModel : BindableObject
{
ObservableCollection<Fighter> _fighters;
// Added this...
public Command<Fighter> FavoriteCommand { get; set; }
public FavFightersViewModel()
{
LoadFighters();
// And this!
FavoriteCommand = new Command<Fighter>((f) =>
{
MessagingCenter.Send(f, "Favorited");
});
}
// More code here...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment