private async void ButtonPinToStart_Click(object sender, RoutedEventArgs e) { if ((AppBarButtonPin.Icon as SymbolIcon).Symbol == Symbol.Pin) { try { var currAccount = ViewModel.MainScreenViewModel.CurrentAccount; var currData = await AccountDataStore.Get(currAccount.LocalAccountId); await ScheduleTileHelper.PinTile(currAccount, currData); UpdatePinVisibility(); } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } } else { try { await ScheduleTileHelper.UnpinTile(ViewModel.MainScreenViewModel.CurrentLocalAccountId); UpdatePinVisibility(); } 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) { var data = await AccountDataStore.Get(ViewModel.Account.LocalAccountId); await ScheduleTileHelper.PinTile(ViewModel.Account, data); } else { await ScheduleTileHelper.UnpinTile(ViewModel.Account.LocalAccountId); } UpdatePinButton(); } catch (Exception ex) { TelemetryExtension.Current?.TrackException(ex); } }