SweepBuilding.xaml.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.Navigation;
  14. using System.Windows.Shapes;
  15. namespace SweepBuilding {
  16. /// <summary>
  17. /// SweepBuilding.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class SweepBuilding : Window {
  20. public SweepBuilding() {
  21. InitializeComponent();
  22. }
  23. public SweepBuilding(UrlInfo info) : this()
  24. {
  25. this.Title = info.Title;
  26. browser.Address=($"http://192.168.20.15:8080/{info.Url}?projId={info.ProjId}&userId={info.UserId}");
  27. // MessageBox.Show(browser.Address);
  28. browser.Loaded += Browser_Loaded;
  29. }
  30. private void Browser_Loaded(object sender, RoutedEventArgs e)
  31. {
  32. MessageBox.Show("加载完成");
  33. }
  34. private void Btn_OnClick(object sender, RoutedEventArgs e)
  35. {
  36. browser.Address = ("www.baidu.com");
  37. }
  38. }
  39. public class UrlInfo {
  40. public string Title { get; set; }
  41. public string Url { get; set; }
  42. public string UserId { get; set; }
  43. public string ProjId { get; set; }
  44. public double ShowWidth { get; set; }
  45. public double ShowHeight { get; set; }
  46. }
  47. }