public ValidatorDialog(ValidatorDetail detail) { InitializeComponent(); this.Content = detail; detail.Update(); }
protected override void ValidationSource_PropertyChanged(object sender, PropertyChangedEventArgs ea) { if (ea.HasPropertyChanged(() => ValidationSource.IsValidating) && ValidationSource.IsValidating == false) { string message = string.Empty; List <ValidationStatus> aggregate = AggregateStatus; ValidationStatus vs = _Status.Matches(aggregate).Max(); if (vs != ValidationStatus.None) { if (_Dialog == null) { ValidatorDetail detail = new ValidatorDetail(); detail.SetBinding(ValidatorDetail.ValidationSourceProperty, new Binding() { Source = this, Path = this.GetPropertyPath(() => ValidationSource) }); detail.SetBinding(ValidatorDetail.PropertyNameProperty, new Binding() { Source = this, Path = this.GetPropertyPath(() => PropertyName) }); detail.SetBinding(ValidatorDetail.StatusProperty, new Binding() { Source = this, Path = this.GetPropertyPath(() => Status) }); detail.Group = true; detail.Max = true; _Dialog = new ValidatorDialog(detail); _Dialog.Closing += (s, e) => { _Dialog = null; }; _Dialog.Owner = Window; _Dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner; _Dialog.Show(); } } } }