using FileDataUpload.viewModel; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; 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.Forms; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace FileDataUpload { /// /// MainWindow.xaml 的交互逻辑 /// public partial class MainWindow : Window { //private readonly NotifyIcon notifyIcon = new NotifyIcon(); public MainWindow() { InitializeComponent(); MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(); this.DataContext = mainWindowViewModel; } /// /// 窗体初始化 /// /// /// private void Window_Loaded(object sender, RoutedEventArgs e) { /*notifyIcon.Visible = true; notifyIcon.Text = "文件数据上传"; notifyIcon.Icon = new Icon("fileIcon.ico"); notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(show_Click); notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(); System.Windows.Forms.MenuItem show = new System.Windows.Forms.MenuItem("显示"); show.Click += new EventHandler(show_Click); notifyIcon.ContextMenu.MenuItems.Add(show); System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("退出"); exit.Click += new EventHandler(exit_Clikc); notifyIcon.ContextMenu.MenuItems.Add(exit);*/ } /// /// 右键菜单显示按钮事件 /// /// /// /*private void show_Click(object Sender, EventArgs e) { if (WindowState == WindowState.Minimized) { WindowState = WindowState.Normal; } Show(); Activate(); }*/ /// /// 右键菜单退出按钮事件 /// /// /// /*private void exit_Clikc(object Sender, EventArgs e) { MessageBoxResult info = System.Windows.MessageBox.Show("请确认是否退出文件上传系统", "文件上传系统退出", MessageBoxButton.OK, MessageBoxImage.Warning); if (info == MessageBoxResult.OK) { Environment.Exit(0); } }*/ /*protected override void OnStateChanged(EventArgs e) { base.OnStateChanged(e); }*/ /// /// 关闭按钮事件 /// /// /*protected override void OnClosing(CancelEventArgs e) { e.Cancel = true; Hide(); base.OnClosing(e); }*/ } }