/// <summary> /// Refresh the view with the model's current state. /// </summary> public override void RefreshView(IModel model) { if (model != null) { models.Clear(); models.AddRange(this.model.FindAllChildren <IModel>().Where(a => a.GetType() != typeof(Memo))); if (models.GroupBy(a => a.GetType()).Count() > 1) { throw new ArgumentException($"The models displayed in a PropertyMultiModelView must all be of the same type"); } if (models.Count() >= 1) { view.DisplayProperties(GetProperties(models)); return; } this.model = model; } }
/// <summary> /// Refresh the view with the model's current state. /// </summary> public override void RefreshView(IModel model) { if (model != null) { models.Clear(); models.AddRange(this.model.FindAllChildren <IModel>().Where(a => a.GetType() != typeof(Memo) && ((model is CLEMModel)?(model as CLEMModel).ChildrenToIgnoreInSummary()?.Where(b => b.IsAssignableFrom(a.GetType())).Any() ?? false == false : true))); if (models.GroupBy(a => a.GetType()).Count() > 1) { throw new ArgumentException($"The models displayed in a PropertyMultiModelView must all be of the same type"); } if (models.Count() >= 1) { view.DisplayProperties(GetProperties(models)); return; } this.model = model; } }