终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

ScreenSplitMealsControl2.xaml.cs 2.3 KiB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /// ScreenSplitMealsControl2.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class ScreenSplitMealsControl2 : UserControl
  21. {
  22. public ScreenSplitMealsControl2()
  23. {
  24. InitializeComponent();
  25. this.DataContext = new ScreenSplitMealsControl2ViewModel();
  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 == "02");
  64. if (dto != null)
  65. {
  66. str = dto.Ad;
  67. Main.GetInstance.InitView2(str, webView, guanggao);
  68. }
  69. }
  70. }
  71. }
  72. }