//下拉菜单 private void MenuItem_Click(object sender, RoutedEventArgs e) { string arg = ((sender as MenuItem).CommandParameter).ToString(); if (arg.Length == 0) { return; } switch (arg) { case "1": //启动宠物 MessageBox.Show("开发中,敬请期待!"); break; case "2": //检查更新 MessageBox.Show("开发中,敬请期待!"); break; case "3": //新闻资讯 View.NewsList news = new View.NewsList(); news.ShowDialog(); break; case "4": //关于 View.About about = new View.About(); about.Show(); break; case "5": //退出 Application.Current.Shutdown(); break; case "0-1": //网页图片下载 View.PageImageDown pageImage = new View.PageImageDown(); pageImage.Show(); break; default: break; } if (this.brMain.Child != this._tlModule) { this.brMain.Child = this._tlModule; } }
private Module.MainModule _mmModule = new Module.MainModule(); //主页模块 public MainWindow() { InitializeComponent(); TaskIcon = new TaskbarIcon(); XamlHelper.Instance.SetBackground(this.mainBoder, TimedTask.Model.PM.AppBgImg); TaskIcon.ShowBalloonTip("提示", "程序运行成功!", BalloonIcon.Info); if (this.brMain.Child != this._tlModule) { this.brMain.Child = this._tlModule; } //弹出资讯 if (Model.PM.ShowNews) { btnMin_Click(null, null); View.NewsList newsList = new View.NewsList(); newsList.Show(); } }