终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

80 rader
2.4 KiB

  1. using BPA.CustomResource.UserControls;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace BPASmartClient.ScreenLib
  17. {
  18. /// <summary>
  19. /// ScreenSplitMealsControl1.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class ScreenSplitMealsControl1 : UserControl
  22. {
  23. public ScreenSplitMealsControl1()
  24. {
  25. InitializeComponent();
  26. this.DataContext = new ScreenSplitMealsControl1ViewModel();
  27. if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
  28. {
  29. guanggao.Visibility = Visibility.Visible;
  30. diqiu.Visibility = Visibility.Collapsed;
  31. }
  32. else
  33. {
  34. guanggao.Visibility = Visibility.Collapsed;
  35. diqiu.Visibility = Visibility.Visible;
  36. }
  37. Show();
  38. }
  39. /// <summary>
  40. /// 点击切换广告
  41. /// </summary>
  42. /// <param name="sender"></param>
  43. /// <param name="e"></param>
  44. private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  45. {
  46. try
  47. {
  48. guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
  49. diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
  50. Show();
  51. }
  52. catch (Exception ex)
  53. {
  54. }
  55. }
  56. /// <summary>
  57. /// 显示广告
  58. /// </summary>
  59. public void Show()
  60. {
  61. string str = string.Empty;
  62. if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
  63. {
  64. AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "01");
  65. if (dto != null)
  66. {
  67. str = dto.Ad;
  68. Main.GetInstance.InitView2(str, webView, guanggao);
  69. }
  70. }
  71. }
  72. }
  73. }