AKROGIS / ThemeManager

NPS Alaska's GIS Theme Manager
2 stars 0 forks source link

Theme list icons are incorrect; missing the red N (New) overlay #48

Open regan-sarwas opened 2 years ago

regan-sarwas commented 2 years ago

The problem started sometime around May/June of 2021. The N is often missing despite a publication date newer than the "Since" settings. Problem can be reproduced in a simple test theme list. The prior release (before May/June 2021) works correctly.

regan-sarwas commented 2 years ago

I believe the problem is due to the change in the setter of the PubDate property in TMNode.cs.

_pubDate = value; at the start of the setter and OnPropertyChanged("PubDate"); at the end of the setter were replaced by SetObservableField(ref _pubDate, value); at the end of the setter.

The problem is the _pubDate needs to be set before calling CalcDaysSinceMyPublication() because that function reads the field (can you say spaghetti code).

Move SetObservableField(ref _pubDate, value); (which sets _pubDate) to the start of the setter. It shouldn't hurt to publish the change before doing the other tasks in the setter.