private async void ShareButton_Click(object sender, RoutedEventArgs e) { _tempHtml = await DetailWebView.InvokeScriptAsync("getHtml", new string[] { }); DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView(); dataTransferManager.DataRequested += IndexPage_DataRequested; DataTransferManager.ShowShareUI(); }
private async void FontFamilyComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!_isInit) { return; } string name = (FontFamilyComboBox.SelectedItem as SystemFont).Name; AppTools.WriteLocalSetting(AppSettings.ReadFontFamily, name); await DetailWebView.InvokeScriptAsync("setFontFamily", new string[] { name }); }
private async void SelectMenu_Mark_Click(object sender, RoutedEventArgs e) { try { await DetailWebView.InvokeScriptAsync("setMark", new string[] { }); } catch (Exception) { new PopupToast(AppTools.GetReswLanguage("Tip_DoNotMarkAgain"), AppTools.GetThemeSolidColorBrush(ColorType.ErrorColor)).ShowPopup(); } }
private async Task SetFontSize() { if (!_isInit) { return; } string oldSize = AppTools.GetLocalSetting(AppSettings.ReadFontSize, "16"); string size = FontSizeTextBox.Text?.Trim(); if (oldSize == size) { return; } if (string.IsNullOrEmpty(size)) { FontSizeTextBox.Text = oldSize; return; } try { int s = Convert.ToInt32(size); if (s > 0) { await DetailWebView.InvokeScriptAsync("setFontSize", new string[] { s.ToString() }); AppTools.WriteLocalSetting(AppSettings.ReadFontSize, s.ToString()); FontSizeTextBox.Text = s.ToString(); return; } } catch (Exception) { } FontSizeTextBox.Text = oldSize; return; }