终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

78 lines
2.3 KiB

  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 BPASmartClient.ScreenLib
  16. {
  17. /// <summary>
  18. /// ScreenMorksControl.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class ScreenMorksControl : UserControl
  21. {
  22. public ScreenMorksControl()
  23. {
  24. InitializeComponent();
  25. this.DataContext = new ScreenMorksControlViewModel();
  26. if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
  27. {
  28. guanggao.Visibility = Visibility.Visible;
  29. diqiu.Visibility = Visibility.Collapsed;
  30. }
  31. else
  32. {
  33. guanggao.Visibility = Visibility.Collapsed;
  34. diqiu.Visibility = Visibility.Visible;
  35. }
  36. Show();
  37. }
  38. /// <summary>
  39. /// 点击切换广告
  40. /// </summary>
  41. /// <param name="sender"></param>
  42. /// <param name="e"></param>
  43. private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  44. {
  45. try
  46. {
  47. guanggao.Visibility = guanggao.Visibility==Visibility.Collapsed? Visibility.Visible: Visibility.Collapsed;
  48. diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
  49. Show();
  50. }
  51. catch (Exception ex)
  52. {
  53. }
  54. }
  55. /// <summary>
  56. /// 显示广告
  57. /// </summary>
  58. public void Show()
  59. {
  60. string str=string.Empty;
  61. if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >=6)
  62. {
  63. AdDTO dto= Main.GetInstance.SaasRouteReturn?.Find(par => par.Address =="04");
  64. if (dto != null)
  65. {
  66. str = dto.Ad;
  67. Main.GetInstance.InitView2(str, webView, guanggao);
  68. }
  69. }
  70. }
  71. }
  72. }