|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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>
- /// ScreenMorksControl.xaml 的交互逻辑
- /// </summary>
- 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();
- }
-
- /// <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 =="04");
- if (dto != null)
- {
- str = dto.Ad;
- Main.GetInstance.InitView2(str, webView, guanggao);
- }
- }
- }
- }
- }
|