83 lines
2.6 KiB
C#
83 lines
2.6 KiB
C#
|
|
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;
|
|||
|
|
using 垂直剖面动态观测系统.ViewModel;
|
|||
|
|
|
|||
|
|
namespace 垂直剖面动态观测系统.View
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Interaction logic for MainWindow.xaml
|
|||
|
|
/// </summary>
|
|||
|
|
public partial class MainView : Window
|
|||
|
|
{
|
|||
|
|
public MainView()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
|
|||
|
|
MainViewModel model = new MainViewModel();
|
|||
|
|
this.DataContext = model;
|
|||
|
|
|
|||
|
|
//设置当前窗口的最大高度为主屏幕的高度,防止遮住状态栏 一般也可以取消 在工控界面之下
|
|||
|
|
this.MaxHeight = SystemParameters.PrimaryScreenHeight;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 顶部蓝色区域按钮按下事件
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.LeftButton == MouseButtonState.Pressed)
|
|||
|
|
this.DragMove();
|
|||
|
|
switch (e.ClickCount)
|
|||
|
|
{
|
|||
|
|
case 2:
|
|||
|
|
{
|
|||
|
|
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 窗体最小化按钮事件
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnMin_Click(object sender, RoutedEventArgs e)
|
|||
|
|
{
|
|||
|
|
this.WindowState = WindowState.Minimized;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 窗体最大化按钮事件
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnMax_Click(object sender, RoutedEventArgs e)
|
|||
|
|
{
|
|||
|
|
this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 窗体关闭按钮事件
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
private void btnClose_Click(object sender, RoutedEventArgs e)
|
|||
|
|
{
|
|||
|
|
this.Close();
|
|||
|
|
Application.Current.Shutdown();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|