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 { /// /// ScreenMorksControl.xaml 的交互逻辑 /// public partial class ScreenMorksControl : UserControl { public ScreenMorksControl() { InitializeComponent(); this.DataContext = new ScreenMorksControlViewModel(); 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 =="04"); if (dto != null) { str = dto.Ad; Main.GetInstance.InitView2(str, webView, guanggao); } } } } }