public CourtCaseHeadingViewModel(CourtCaseHeading heading)
     : base()
 {
     if (heading == null)
     {
         throw new ArgumentNullException("heading");
     }
     Heading = heading;
     if (Heading is CourtCaseHistoryHeading)
     {
         this.IsVisible = false;
     }
     else
     {
         this.IsVisible = true;
     }
     this.WhenAny(x => x.IsExpanded, x => x.Value)
         .Subscribe(x =>
         {
             this.Childs.Aggregate(0, (index, item) =>
                 {
                     item.IsVisible = x;
                     return ++index;
                 }
                 );
         }
         );
 }
 public NewCourtCaseCreatedEvent(CourtCase courtCase, CourtCaseHeading heading)
 {
     if (courtCase == null)
     {
         throw new ArgumentNullException("courtCase");
     }
     if (heading == null)
     {
         throw new ArgumentNullException("heading");
     }
     CourtCase = courtCase;
     CourtCaseHeading = heading;
 }
 public DocketStrategy(CourtCaseHeading caseHeading,  Hearings hearing)
     : base()
 {
     if (caseHeading == null)
     {
         throw new ArgumentNullException("caseHeading");
     }
     if (hearing == null)
     {
         throw new ArgumentNullException("hearing");
     }
     _hearing = hearing;
     _caseHeading = caseHeading;
 }
     private void FixupParentCourtCaseHeading(CourtCaseHeading previousValue)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (previousValue != null && previousValue.CourtCaseHistoryHeadings.Contains(this))
         {
             previousValue.CourtCaseHistoryHeadings.Remove(this);
         }
 
         if (ParentCourtCaseHeading != null)
         {
             ParentCourtCaseHeading.CourtCaseHistoryHeadings.Add(this);
 
             CourtCaseHeadingCourtCaseId = ParentCourtCaseHeading.CourtCaseId;
         }
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("ParentCourtCaseHeading")
                 && (ChangeTracker.OriginalValues["ParentCourtCaseHeading"] == ParentCourtCaseHeading))
             {
                 ChangeTracker.OriginalValues.Remove("ParentCourtCaseHeading");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("ParentCourtCaseHeading", previousValue);
             }
             if (ParentCourtCaseHeading != null && !ParentCourtCaseHeading.ChangeTracker.ChangeTrackingEnabled)
             {
                 ParentCourtCaseHeading.StartTracking();
             }
         }
     }
 protected override void ClearNavigationProperties()
 {
     base.ClearNavigationProperties();
     ParentCourtCaseHeading = null;
 }