public override void Execute(ListLogicalView view) { var plan = LocateCurrentSummarizingMonth(view); if (plan == null) { App.MessageBox.Show("没有找到本月正在进行中的计划。", MessageBoxButton.OK, MessageBoxImage.Asterisk); return; } var block = new Block(typeof(WeekSummary)); var ui = AutoUI.AggtUIFactory.GenerateControl(block); var weekView = ui.MainView as ListLogicalView; MPHelper.ModifyRowStyle(weekView, "WeekSummaryRowStyle"); SetData(weekView, plan); weekView.ExpandAll(); var btn = App.Windows.ShowDialog(ui.Control, win => { win.Title = string.Format("第 {0} 周计划与总结", TimeHelper.CurrentWeekIndex + 1); win.Buttons = ViewDialogButtons.YesNo; }); if (btn == WindowButton.Yes) { ReadData(weekView, plan); } }
protected override void OnUIGenerated(ControlResult ui) { base.OnUIGenerated(ui); this._planView = ui.MainView as ListLogicalView; this._taskView = this._planView.GetChildView(typeof(TaskOrCategory)) as ListLogicalView; this._weekCompletionView = this._taskView.GetChildView(typeof(WeekCompletion)) as ListLogicalView; var weekNoteView = this._planView.GetChildView(typeof(WeekNote)) as ListLogicalView; MPHelper.ModifyRowStyle(this._taskView, "TaskViewRowStyle"); MPHelper.ModifyRowStyle(this._weekCompletionView, "CurrentWeekRowStyle"); MPHelper.ModifyRowStyle(weekNoteView, "CurrentWeekRowStyle"); this.ChangeTaskCompletionVisibility(); this.AddWeekNotesOnPlan(); }