protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter != null) { subject = SubjectManager.GetSubject((e.Parameter as Subject).id); tbx_Name_AddSubject.Text = subject.subject_name; tbx_Teacher_AddSubject.Text = subject.teacher; gvw_ColorPicker_AddSubject.SelectedItem = SubjectColorManager.GetList().Find(x => x.name == subject.color.name); edit = true; } }
void Start() { //只接收开心程度大于10的发射... SubjectManager.GetSubject <HappySubjectArgs>().Where(e => e.HappyDegree > 10) .Subscribe(e => print("开心程度:" + e.HappyDegree + "...看起来很开心")); Observable.EveryUpdate().Where(_ => Input.GetMouseButtonDown(0)) .Select((_, count) => count) .Subscribe(count => SubjectManager.Fire(new HappySubjectArgs() { HappyDegree = count++ })); }