You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdWindow.xaml.cs 1.1 KiB

2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
2 jaren geleden
12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace HKCardOUT.Views
  15. {
  16. /// <summary>
  17. /// AdWindow.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class AdWindow : HandyControl.Controls.Window
  20. {
  21. public AdWindow(string input)
  22. {
  23. InitializeComponent();
  24. InitView2(input);
  25. }
  26. public async void InitView2(string input)
  27. {
  28. StringBuilder sb = new StringBuilder();
  29. sb.Append($"<html><body>{input}</body></html>");
  30. var html = sb.ToString();
  31. await view2.EnsureCoreWebView2Async(null);
  32. view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;
  33. view2.CoreWebView2.Settings.AreDevToolsEnabled = false;
  34. view2.CoreWebView2.NavigateToString(html);
  35. }
  36. }
  37. }