private void UpdatePinButton() { try { if (QuickAddTileHelper.IsPinned(ViewModel.Account.LocalAccountId)) { appBarPin.Icon = new SymbolIcon(Symbol.UnPin); appBarPin.Label = LocalizedResources.GetString("Tile_UnpinTile"); } else { appBarPin.Icon = new SymbolIcon(Symbol.Pin); appBarPin.Label = LocalizedResources.GetString("Tile_PinTile"); } } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } }
private async void appBarPin_Click(object sender, RoutedEventArgs e) { try { if ((appBarPin.Icon as SymbolIcon).Symbol == Symbol.Pin) { await QuickAddTileHelper.PinTileAsync(ViewModel.Account.LocalAccountId); } else { await QuickAddTileHelper.UnpinTile(ViewModel.Account.LocalAccountId); } UpdatePinButton(); } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } }