Created
December 23, 2019 20:37
-
-
Save jfversluis/8be3c0f196faa9ccf3b8ab9f815c8917 to your computer and use it in GitHub Desktop.
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
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