|
|
@ -14,6 +14,7 @@ using System.Windows.Data; |
|
|
|
using System.Windows.Documents; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Windows.Input; |
|
|
|
using System.Windows.Interop; |
|
|
|
using System.Windows.Media; |
|
|
|
using System.Windows.Media.Imaging; |
|
|
|
using System.Windows.Navigation; |
|
|
@ -35,6 +36,7 @@ namespace SunlightCentralizedControlManagement_SCCM_ |
|
|
|
|
|
|
|
public MainWindow() |
|
|
|
{ |
|
|
|
WindowStartupLocation = WindowStartupLocation.CenterScreen; |
|
|
|
DataContext = new MainWindowViewModel(); |
|
|
|
InitializeComponent(); |
|
|
|
CountDown(); |
|
|
@ -144,7 +146,6 @@ namespace SunlightCentralizedControlManagement_SCCM_ |
|
|
|
{ |
|
|
|
Picture.Content = new View.DispenseView(); |
|
|
|
} |
|
|
|
|
|
|
|
private void Buttonhelp_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
WindowsView.Help help_page = new WindowsView.Help(); |
|
|
@ -242,7 +243,15 @@ namespace SunlightCentralizedControlManagement_SCCM_ |
|
|
|
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)//打开页面
|
|
|
|
{ |
|
|
|
var windowHandle = new WindowInteropHelper(this).Handle; |
|
|
|
var currentScreen = Screen.FromHandle(windowHandle); |
|
|
|
|
|
|
|
System.Drawing.Rectangle rectangle = currentScreen.WorkingArea; |
|
|
|
|
|
|
|
this.Left = rectangle.Left; |
|
|
|
this.Top=rectangle.Top; |
|
|
|
this.Width = rectangle.Width; |
|
|
|
this.Height = rectangle.Height; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|