|
- using BPA.CustomResource.UserControls;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
-
- namespace BPASmartClient.ScreenLib
- {
- /// <summary>
- /// ScreenSplitMealsControl1.xaml 的交互逻辑
- /// </summary>
- public partial class ScreenSplitMealsControl1 : UserControl
- {
- public ScreenSplitMealsControl1()
- {
- InitializeComponent();
- this.DataContext = new ScreenSplitMealsControl1ViewModel();
-
- if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
- {
- guanggao.Visibility = Visibility.Visible;
- diqiu.Visibility = Visibility.Collapsed;
- }
- else
- {
- guanggao.Visibility = Visibility.Collapsed;
- diqiu.Visibility = Visibility.Visible;
- }
- Show();
- }
-
-
- /// <summary>
- /// 点击切换广告
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
- {
- try
- {
- guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
- diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
- Show();
- }
- catch (Exception ex)
- {
-
- }
- }
-
- /// <summary>
- /// 显示广告
- /// </summary>
- public void Show()
- {
- string str = string.Empty;
- if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
- {
- AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "01");
- if (dto != null)
- {
- str = dto.Ad;
- Main.GetInstance.InitView2(str, webView, guanggao);
- }
- }
- }
- }
- }
|