public WeekOverviewViewModel() { _dataService = new MainDataService(); _currentUserName = _dataService.UserName; CurrentFirstDayOfWeek = new Week(DateTime.Now).FirstDayOfWeek; }
public MainWindow(MainDataService dataService, PaletteSelectorViewModel paletteSelector, ConfigPage configPage) { InitializeComponent(); DataContext = dataService; panel1.DataContext = paletteSelector; Messenger.Default.Register <String>(this, "打开设置", msg => configPage.ShowDialog()); this.Unloaded += (sender, e) => Messenger.Default.Unregister(this); this.Closing += (sender, e) => { Application.Current.Shutdown();//关闭 Environment.Exit(0); }; }