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.
115 lines
3.9 KiB
115 lines
3.9 KiB
using SunlightAggregationManager.UserClass;
|
|
using SunlightAggregationManager.ViewModel;
|
|
using System.Text;
|
|
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 SunlightAggregationManager
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
GlobalLogManager.RegisterTarget(LOG);
|
|
|
|
DataContext = new MainWindowViewModel();
|
|
}
|
|
|
|
//标题栏拖动
|
|
private void GridTitle_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
if (e.ChangedButton == MouseButton.Left)
|
|
DragMove();
|
|
}
|
|
|
|
//最大
|
|
private void maximize_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (WindowState == WindowState.Maximized)
|
|
{ WindowState = WindowState.Normal; }
|
|
else
|
|
{ WindowState = WindowState.Maximized; }
|
|
}
|
|
//最小
|
|
private void minimize_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (WindowState == WindowState.Minimized)
|
|
{ WindowState = WindowState.Normal; }
|
|
else
|
|
{ WindowState = WindowState.Minimized; }
|
|
}
|
|
//关闭
|
|
private void exit_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
// 关闭整个应用程序
|
|
System.Windows.Application.Current.Shutdown();
|
|
}
|
|
|
|
private void ListViewItem_MouseLeftButtonUp_state(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Visible;
|
|
Picture.Visibility= Visibility.Collapsed;
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_serve(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_log(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
Picture.Content = new View.logPage();
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_machine(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_extend(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_user(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
Picture.Content = new View.UserPage();
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_Action(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
}
|
|
|
|
private void ListViewItem_MouseLeftButtonUp_set(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
Picture.Content = new View.SettingPage();
|
|
}
|
|
private void ListViewItem_MouseLeftButtonUp_help(object sender, MouseButtonEventArgs e)
|
|
{
|
|
state.Visibility = Visibility.Collapsed;
|
|
Picture.Visibility = Visibility.Visible;
|
|
Picture.Content = new View.imgQR();
|
|
}
|
|
|
|
|
|
}
|
|
}
|