Exemplo n.º 1
0
        /// <summary>Viewを表示した後呼び出されます。</summary>
        /// <param name="navigationContext">Navigation Requestの情報を表すNavigationContext。</param>
        void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
        {
            if (this.testPoint != null)
            {
                return;
            }
            this.testPoint = navigationContext.Parameters["TargetData"] as TestPointInformation;

            this.TestDate = this.testPoint
                            .ToReactivePropertyAsSynchronized(x => x.TestDate)
                            .AddTo(this.disposables);
            this.JapaneseScore = this.testPoint
                                 .ToReactivePropertyAsSynchronized(x => x.JapaneseScore)
                                 .AddTo(this.disposables);
            this.MathematicsScore = this.testPoint
                                    .ToReactivePropertyAsSynchronized(x => x.MathematicsScore)
                                    .AddTo(this.disposables);
            this.EnglishScore = this.testPoint
                                .ToReactivePropertyAsSynchronized(x => x.EnglishScore)
                                .AddTo(this.disposables);
            this.Average = this.testPoint.ObserveProperty(x => x.Average)
                           .ToReadOnlyReactivePropertySlim()
                           .AddTo(this.disposables);

            this.RaisePropertyChanged(nameof(this.TestDate));
            this.RaisePropertyChanged(nameof(this.JapaneseScore));
            this.RaisePropertyChanged(nameof(this.MathematicsScore));
            this.RaisePropertyChanged(nameof(this.EnglishScore));
            this.RaisePropertyChanged(nameof(this.Average));
        }
Exemplo n.º 2
0
        /// <summary>Viewを表示した後呼び出されます。</summary>
        /// <param name="navigationContext">Navigation Requestの情報を表すNavigationContext。</param>
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            if (this.testPoint != null)
            {
                return;
            }
            this.testPoint = navigationContext.Parameters["TargetData"] as TestPointInformation;

            this.TestDate = this.testPoint
                            .ToReactivePropertyAsSynchronized(x => x.TestDate)
                            .SetValidateNotifyError(v => this.getTestDateError(v))
                            .AddTo(this.disposables);
            this.JapaneseScore = this.testPoint
                                 .ToReactivePropertyAsSynchronized(x => x.JapaneseScore)
                                 .SetValidateAttribute(() => this.JapaneseScore)
                                 .AddTo(this.disposables);
            this.MathematicsScore = this.testPoint
                                    .ToReactivePropertyAsSynchronized(x => x.MathematicsScore)
                                    .SetValidateAttribute(() => this.MathematicsScore)
                                    .AddTo(this.disposables);
            this.EnglishScore = this.testPoint
                                .ToReactivePropertyAsSynchronized(x => x.EnglishScore)
                                .SetValidateAttribute(() => this.EnglishScore)
                                .AddTo(this.disposables);
            this.Average = this.testPoint.ObserveProperty(x => x.Average)
                           .ToReadOnlyReactivePropertySlim()
                           .AddTo(this.disposables);

            this.RaisePropertyChanged(null);
        }