public GiftPopup(IProtoService protoService, INavigationService navigationService, User user, IList <PremiumGiftOption> options) { InitializeComponent(); _protoService = protoService; _navigationService = navigationService; _selectedOption = options.FirstOrDefault(); Title = Strings.Resources.GiftTelegramPremiumTitle; TextBlockHelper.SetMarkdown(Subtitle, string.Format(Strings.Resources.GiftTelegramPremiumDescription, user.FirstName)); ScrollingHost.ItemsSource = options; var footer = Strings.Resources.GiftPremiumListFeaturesAndTerms; var hereBegin = footer.IndexOf('*'); var hereEnd = footer.IndexOf('*', hereBegin + 1); var hyperlink = new Hyperlink(); hyperlink.Inlines.Add(new Run { Text = footer.Substring(hereBegin + 1, hereEnd - hereBegin - 1) }); Footer.Inlines.Add(new Run { Text = footer.Substring(0, hereBegin) }); Footer.Inlines.Add(hyperlink); Footer.Inlines.Add(new Run { Text = footer.Substring(hereEnd + 1) }); }
private void Option_Checked(object sender, RoutedEventArgs e) { if (sender is FrameworkElement element && element.Tag is PremiumGiftOption option) { _selectedOption = option; PurchaseCommand.Content = string.Format(Strings.Resources.GiftSubscriptionFor, Locale.FormatCurrency(option.Amount, option.Currency)); } }