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 { /// /// ScreenSplitMealsControl2.xaml 的交互逻辑 /// public partial class ScreenSplitMealsControl2 : UserControl { public ScreenSplitMealsControl2() { InitializeComponent(); this.DataContext = new ScreenSplitMealsControl2ViewModel(); 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(); } /// /// 点击切换广告 /// /// /// 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) { } } /// /// 显示广告 /// 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 == "02"); if (dto != null) { str = dto.Ad; Main.GetInstance.InitView2(str, webView, guanggao); } } } } }