You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.2 KiB
C#

using SlnMesnac.Model.AirportApiEntity;
using SlnMesnac.TouchSocket;
using SlnMesnac.WPF.ViewModel;
5 months ago
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;
3 months ago
using System.Windows;
using System.Windows.Forms;
5 months ago
namespace SlnMesnac.WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
3 months ago
//托盘
NotifyIcon trayIcon;
//注册AreaIcon属性用于托盘的图标
public static readonly DependencyProperty AreaIconProperty =
DependencyProperty.Register("AreaIcon", typeof(ImageSource), typeof(MainWindow));
//注册AreaText属性用于鼠标滑到托盘图标时显示的文字
public static readonly DependencyProperty AreaTextProperty =
DependencyProperty.Register("AreaText", typeof(string), typeof(MainWindow));
//注册AreaVisibility属性用于显示隐藏托盘图标
public static readonly DependencyProperty AreaVisibilityProperty =
DependencyProperty.Register("AreaVisibility", typeof(bool), typeof(MainWindow));
//注册AreaMenuItems属性用于托盘右键在单的列表
public static readonly DependencyProperty AreaMenuItemsProperty =
DependencyProperty.Register("AreaMenuItems", typeof(List<MenuItem>), typeof(MainWindow), new PropertyMetadata(new List<MenuItem>()));
5 months ago
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
}
3 months ago
private void AddTrayIcon()
{
3 months ago
if (trayIcon != null)
{
return;
}
trayIcon = new NotifyIcon
{
};
}
3 months ago
private void Window_Loaded(object sender, RoutedEventArgs e)
{
3 months ago
}
3 months ago
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
3 months ago
5 months ago
}
}