private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e) { System.Windows.Controls.MenuItem menuItem = sender as System.Windows.Controls.MenuItem; switch (menuItem.Header) { case "打开壁纸": if (wallpaper == null || wallpaper.IsClosed) { wallpaper = new Wallpaper(this); wallpaper.Show(); } wallpaper.Activate(); wallpaper.WindowState = System.Windows.WindowState.Normal; break; case "软件设置": Setting setting = new Setting(); setting.ChangeConfigEvent += Setting_ChangeConfigEvent; setting.ShowDialog(); break; case "立即屏保": timerS.Stop(); screensaver = new Screensaver(); screensaver.ShowDialog(); break; case "调试": //string url = "http://localhost:53054/Update/CheckUpdate"; AutoUpdate.Helper.UpdateHelper.CheckUpdateAsyn(); break; } }
private void NotifyIconContextContent_MouseDoubleClick(object sender, System.Windows.RoutedEventArgs e) { if (wallpaper == null || wallpaper.IsClosed) { wallpaper = new Wallpaper(this); wallpaper.Show(); } wallpaper.Activate(); wallpaper.WindowState = System.Windows.WindowState.Normal; }
/// <summary> /// 构造函数 /// </summary> /// <param name="showWallpaper">是否显示壁纸界面</param> public MainWindow(bool showWallpaper) { WebImage.AsynLoadType(); InitializeComponent(); InitDB(); CleanCache(); if (showWallpaper) { Wallpaper wall = new Wallpaper(this); wall.Show(); } this.Left = (SystemParameters.WorkArea.Size.Width / 4) * 3; }