Grial-UI-Kit-Support
Grial-UI-Kit-Support copied to clipboard
Toggle between Favorite and FavoriteBorder icon on ProductItemViewPage
I would like to toggle between the Favorite and FavoriteBorder icon when something happens. Here is my XAML code.
NOTE: The GestureRecognizer code base posted below won't display correctly in the GitHub code formatter, so I had to move it below.
<Label x:Name="favoriteLabel" Grid.Row="0" Text="{Binding CurrentOffer.SaveStatus}" FontSize="{ artina:OnOrientationDouble Default=28, PortraitPhone=28, LandscapePhone=28, PortraitTablet=38, LandscapeTablet=32 }" TextColor="{ DynamicResource AccentColor }" Style="{ StaticResource FontIcon }" HorizontalOptions="End" VerticalTextAlignment="Start" Margin="20,15,20,0" ></Label>
<Label.GestureRecognizers> <TapGestureRecognizer Command="{Binding SaveOfferCommand}" NumberOfTapsRequired="1" /> </Label.GestureRecognizers>
So far, I can set the icon by doing something like this in the cs file Init method.
string font = GrialShapesFont.FavoriteBorder; this.favoriteLabel.Text = font;
When I try to update the icon using something like this in the ViewModel, nothing happens.
CurrentOffer.SaveStatus = GrialShapesFont.Favorite;
I've even tried to use something like this that inherits INotifyPropertyChanged in the BaseViewModel.
SaveStatus = GrialShapesFont.Favorite;
Does anyone know a good way to do this for both iOS and Android?
Any help is much appreciated. Thanks!