终端一体化运控平台
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ScreenMorksControl.xaml.cs 2.3 KiB

vor 2 Jahren
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. }