@@ -20,8 +20,8 @@ namespace BPASmartClient.ScreenLib | |||
WindowLargeScreen windowLarge = new WindowLargeScreen(); | |||
#region 设置显示页面与标题 | |||
string TitleName = $"{type.Assembly.ManifestModule.Name.Replace(".dll", "")}"; | |||
string name= type.FullName.Split('.')[2]; | |||
string sbmc=string.Empty; | |||
string name = type.FullName.Split('.')[2]; | |||
string sbmc = string.Empty; | |||
switch (type.FullName) | |||
{ | |||
case "BPASmartClient.ScreenALL.App": | |||
@@ -37,10 +37,63 @@ namespace BPASmartClient.ScreenLib | |||
windowLarge.Init(TitleName, new ScreenMorksControl()); windowLarge.Show(); | |||
break; | |||
case "BPASmartClient.ScreenSplitMeals.App": | |||
ScreenSplitMealsControl1 ScreenSplit=new ScreenSplitMealsControl1(); | |||
ScreenSplitMealsControl1 ScreenSplit = new ScreenSplitMealsControl1(); | |||
windowLarge.Init("一号" + TitleName, ScreenSplit); | |||
windowLarge.Show(); | |||
ScreenSplit.Start(TitleName); | |||
WindowLargeScreen windowLarge2 = new WindowLargeScreen(); | |||
windowLarge2.Init("二号" + TitleName, new ScreenSplitMealsControl2()); | |||
WindowLargeScreen windowLarge3 = new WindowLargeScreen(); | |||
windowLarge3.Init("三号" + TitleName, new ScreenSplitMealsControl3()); | |||
int i = 0; | |||
foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens) | |||
{ | |||
if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["一号屏"].ToString()) | |||
{ | |||
windowLarge.WindowStartupLocation = WindowStartupLocation.Manual; | |||
windowLarge.Left = scr.WorkingArea.Left; | |||
windowLarge.Top = scr.WorkingArea.Top; | |||
windowLarge.Width = scr.Bounds.Width; | |||
windowLarge.Height = scr.Bounds.Height; | |||
windowLarge.WindowState = WindowState.Maximized; | |||
windowLarge.ResizeMode = ResizeMode.NoResize; | |||
windowLarge.WindowStyle = WindowStyle.None; | |||
windowLarge.WindowState = WindowState.Normal; | |||
windowLarge.ShowInTaskbar = false; | |||
windowLarge.Topmost = true; | |||
} | |||
else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["二号屏"].ToString()) | |||
{ | |||
windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual; | |||
windowLarge2.Left = scr.WorkingArea.Left; | |||
windowLarge2.Top = scr.WorkingArea.Top; | |||
windowLarge2.Width = scr.Bounds.Width; | |||
windowLarge2.Height = scr.Bounds.Height; | |||
windowLarge2.WindowState = WindowState.Maximized; | |||
windowLarge2.ResizeMode = ResizeMode.NoResize; | |||
windowLarge2.WindowStyle = WindowStyle.None; | |||
windowLarge2.WindowState = WindowState.Normal; | |||
windowLarge2.ShowInTaskbar = false; | |||
windowLarge2.Topmost = true; | |||
} | |||
else if (i.ToString() == System.Configuration.ConfigurationManager.AppSettings["三号屏"].ToString()) | |||
{ | |||
windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual; | |||
windowLarge3.Left = scr.WorkingArea.Left; | |||
windowLarge3.Top = scr.WorkingArea.Top; | |||
windowLarge3.Width = scr.Bounds.Width; | |||
windowLarge3.Height = scr.Bounds.Height; | |||
windowLarge3.WindowState = WindowState.Maximized; | |||
windowLarge3.ResizeMode = ResizeMode.NoResize; | |||
windowLarge3.WindowStyle = WindowStyle.None; | |||
windowLarge3.WindowState = WindowState.Normal; | |||
windowLarge3.ShowInTaskbar = false; | |||
windowLarge3.Topmost = true; | |||
} | |||
i++; | |||
} | |||
windowLarge.Show(); windowLarge2.Show(); windowLarge3.Show(); | |||
break; | |||
} | |||
#endregion | |||
@@ -26,45 +26,5 @@ namespace BPASmartClient.ScreenLib | |||
InitializeComponent(); | |||
this.DataContext = new ScreenSplitMealsControl1ViewModel(); | |||
} | |||
public void Start(string name) | |||
{ | |||
WindowShow windowLarge2 = new WindowShow(); | |||
windowLarge2.Init("二号" + name, new ScreenSplitMealsControl2()); | |||
WindowShow windowLarge3 = new WindowShow(); | |||
windowLarge3.Init("三号"+ name, new ScreenSplitMealsControl3()); | |||
int i = 0; | |||
foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens) | |||
{ | |||
if (!scr.Primary) | |||
{ | |||
if (i == 1) | |||
{ | |||
windowLarge2.WindowStartupLocation = WindowStartupLocation.Manual; | |||
windowLarge2.Left = scr.WorkingArea.Left; | |||
windowLarge2.Top = scr.WorkingArea.Top; | |||
windowLarge2.Width = scr.Bounds.Width; | |||
windowLarge2.Height = scr.Bounds.Height; | |||
windowLarge2.WindowState = WindowState.Maximized; | |||
windowLarge2.ResizeMode = ResizeMode.NoResize; | |||
windowLarge2.WindowStyle = WindowStyle.None; | |||
windowLarge2.WindowState = WindowState.Normal; | |||
windowLarge2.ShowInTaskbar = false; | |||
} | |||
else if (i == 2) | |||
{ | |||
windowLarge3.WindowStartupLocation = WindowStartupLocation.Manual; | |||
windowLarge3.Left = scr.WorkingArea.Left; | |||
windowLarge3.Top = scr.WorkingArea.Top; | |||
windowLarge3.Width = scr.Bounds.Width; | |||
windowLarge3.Height = scr.Bounds.Height; | |||
} | |||
i++; | |||
} | |||
} | |||
windowLarge2.Show(); windowLarge3.Show(); | |||
} | |||
} | |||
} |
@@ -1,31 +0,0 @@ | |||
<Window x:Class="BPASmartClient.ScreenLib.WindowShow" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:local="clr-namespace:BPASmartClient.ScreenLib" | |||
mc:Ignorable="d" | |||
WindowStartupLocation="Manual" | |||
WindowState="Maximized" | |||
WindowStyle="None" | |||
Title="监控大屏" Height="1080" Width="1920"> | |||
<Window.Resources> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" /> | |||
</ResourceDictionary.MergedDictionaries> | |||
</ResourceDictionary> | |||
</Window.Resources> | |||
<Grid Background="{DynamicResource image大屏}"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="100"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<GroupBox x:Name="titlename" Header="攀华产线数据可视化大屏" Style="{DynamicResource TopStyle}" Tag="Start"> | |||
</GroupBox> | |||
<Border x:Name="main" Grid.Row="1"> | |||
</Border> | |||
</Grid> | |||
</Window> |
@@ -1,41 +0,0 @@ | |||
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.Shapes; | |||
namespace BPASmartClient.ScreenLib | |||
{ | |||
/// <summary> | |||
/// WindowShow.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class WindowShow : Window | |||
{ | |||
public WindowShow() | |||
{ | |||
InitializeComponent(); | |||
this.KeyDown += new KeyEventHandler((o, k) => | |||
{ | |||
if (k.Key == Key.Escape) | |||
{ | |||
if (MessageBox.Show("确认是否退出大屏!", "退出提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes) | |||
this.Close(); | |||
} | |||
}); | |||
} | |||
public void Init(string title, UserControl user) | |||
{ | |||
titlename.Header = title; | |||
main.Child = user; | |||
} | |||
} | |||
} |
@@ -6,5 +6,9 @@ | |||
<!--订阅主题设置:大炒,小炒,分餐机,煮面机--> | |||
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/> | |||
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/> | |||
<add key="一号屏" value="1"/> | |||
<add key="二号屏" value="0"/> | |||
<add key="三号屏" value="0"/> | |||
</appSettings> | |||
</configuration> |
@@ -8,5 +8,6 @@ | |||
Title="MainWindow" Height="450" Width="800"> | |||
<Grid> | |||
<TextBox x:Name="textwb" Background="Black" Foreground="#FFC000FB" TextWrapping="Wrap" AcceptsReturn="True" ></TextBox> | |||
<Button Width="100" Height="100" Click="Button_Click" Visibility="Collapsed"></Button> | |||
</Grid> | |||
</Window> |
@@ -45,6 +45,7 @@ namespace WpfTest | |||
InitializeComponent(); | |||
Connection(); | |||
ThreadServer(); | |||
//Button_Click(null, null); | |||
} | |||
public void ThreadServer() | |||
{ | |||
@@ -342,5 +343,37 @@ namespace WpfTest | |||
})); | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
int i = 0; | |||
Window1 window1 = new Window1(); | |||
foreach (System.Windows.Forms.Screen scr in System.Windows.Forms.Screen.AllScreens) | |||
{ | |||
//if (!scr.Primary) | |||
{ | |||
if (i == 1) | |||
{ | |||
window1.WindowStartupLocation = WindowStartupLocation.Manual; | |||
window1.Left = scr.WorkingArea.Left; | |||
window1.Top = scr.WorkingArea.Top; | |||
window1.Width = scr.Bounds.Width; | |||
window1.Height = scr.Bounds.Height; | |||
window1.WindowState = WindowState.Maximized; | |||
window1.ResizeMode = ResizeMode.NoResize; | |||
window1.WindowStyle = WindowStyle.None; | |||
window1.WindowState = WindowState.Normal; | |||
window1.ShowInTaskbar = false; | |||
window1.Show(); | |||
} | |||
else if (i == 2) | |||
{ | |||
} | |||
i++; | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
<Window x:Class="WpfTest.Window1" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:local="clr-namespace:WpfTest" | |||
mc:Ignorable="d" | |||
Title="Window1" Height="450" Width="800"> | |||
<Grid> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,27 @@ | |||
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.Shapes; | |||
namespace WpfTest | |||
{ | |||
/// <summary> | |||
/// Window1.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class Window1 : Window | |||
{ | |||
public Window1() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |