/// <summary> /// Bind a Summary to this Case. /// </summary> public void BindSummary(Summary summary) { // There is Nothing to Do. Summary already belongs to this Case. if (summary.CaseId == Id) { return; } #region Incident Rule // For now a Case may only have 1 Incident Summary (In the future this may change to allow multiple incidents per Case) var incidentSummary = summary as IncidentSummary; if (incidentSummary != null && PrimaryIncident != null) { throw new Exception("This Case Already has a Primary Incident Summary."); } #endregion // Make Sure the Summary Is Bound to this Case if (summary.CaseId != Id) { summary.BindToCase(this); } // Make Sure the Summary belongs to this Case. if (!Summaries.Any(x => x.Id == summary.Id)) { SummaryCollection.Add(summary); } }
private void InitializeConfigurationPanel() { Children.Clear(); _summaryViewModels.Clear(); if (Summaries?.Any() ?? false) { if (GroupHeader != null) { Children.Add(ViewHelper.CreateGroupHeader(GroupHeader, null)); } foreach (var summary in Summaries) { var summaryViewModel = this.AddSummaryRow(summary); summaryViewModel.AnimationCompleted += (sender, e) => LayoutChanged?.Invoke(this, LayoutChangedEventArgs.NonInitialization); _summaryViewModels.Add(summaryViewModel); } } UpdateSummaryVisibility(EmptyContext.Instance, true); LayoutChanged?.Invoke(this, LayoutChangedEventArgs.Initialization); }