Skip to content

Commit

Permalink
FamilyData.XHasValue
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Mar 12, 2024
1 parent 0da7a50 commit 5a0cc72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/Models/FamilyData/EmergencyFund.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public int? MonthlyExpenses
{
FamilyData.UpdateValueInXUnits();
FamilyData.UpdateChangeInXUnits();
FamilyData.UpdateXHasValue();
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions library/Models/FamilyData/FamilyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public bool DebtsComplete
}

public double? ValueInXUnits { get { return valueInXUnits; } set { valueInXUnits = value; OnPropertyChanged(); } }
public bool XHasValue { get { return xHasValue; } set { xHasValue = value; OnPropertyChanged(); } }
public double? ChangeInXUnits { get { return changeInXUnits; } set { changeInXUnits = value; OnPropertyChanged(); } }

public TriState DebtFree { get; set; }
Expand Down Expand Up @@ -730,6 +731,7 @@ public int PersonCount
[JsonIgnore]
public SortedDictionary<string, List<Investment>>? TickersToUpdate;
private double? valueInXUnits;
private bool xHasValue;
private double? changeInXUnits;

public async Task RefreshPrices(HttpClient http)
Expand Down Expand Up @@ -1014,4 +1016,9 @@ internal void UpdateChangeInXUnits()

ChangeInXUnits = changeInXUnits;
}

internal void UpdateXHasValue()
{
XHasValue = EmergencyFund.AnnualExpenses.HasValue && EmergencyFund.AnnualExpenses != 0.0;
}
}

0 comments on commit 5a0cc72

Please sign in to comment.