You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

95 lines
2.7 KiB

using IOTContainer.Common;
using IOTContainer.Model;
using IOTContainer.ViewModel;
using LibVLCSharp.Shared;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
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.Interop;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
namespace IOTContainer.View
{
/// <summary>
/// ScreenWindow.xaml 的交互逻辑
/// </summary>
public partial class ScreenWindow : Window
{
private bool _touchMeOpened;
public ScreenWindow()
{
ComParameters.Parameters.EdgeWindow?.StopTimer();
InitializeComponent();
this.Top = 0;
this.Left = 0;
//设置窗口大小
this.WindowState = WindowState.Maximized;
//this.Width = SystemParameters.PrimaryScreenWidth;
//this.Height = SystemParameters.PrimaryScreenHeight;
ComParameters.Parameters.ScreenWindow = this;
this.DataContext = ComParameters.Parameters.ScreenViewModel = new ScreenWindowViewModel();
}
#region 窗口事件
private void Window_Closed(object sender, EventArgs e)
{
ComParameters.Parameters.EdgeWindow?.StartNewTimer();
ComParameters.Parameters.IsPlay = false;
ComParameters.Parameters.ScreenWindow = null;
}
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
try
{
switch (ComParameters.Parameters.devType)
{
case "导视":
{
ComParameters.Parameters.TouchMe?.Dispatcher.Invoke(() =>
{
ComParameters.Parameters.TouchMe.Close();
});
this.Close();
break;
}
case "信发":
{
break;
}
}
}
catch (Exception ex)
{
Log.MyLog.WriteLogFile("ScreenWindow关闭失败:" + ex.Message);
}
}
#endregion
public void ShowScreen()
{
this.Show();
WinApi.FindSetTop(null, "ScreenWindow");
var toucheMe = new TouchMe();
toucheMe.Show();
}
}
}