daniel-lerch / vocup

Vocabulary trainer.
https://www.microsoft.com/p/vocup/9n6w2h3qjqmm
GNU Affero General Public License v3.0
9 stars 3 forks source link

Fixed counts in statistics not resetting on book close #49

Closed jdelange22 closed 2 months ago

jdelange22 commented 3 months ago

Fixes #47

jdelange22 commented 3 months ago

@daniel-lerch so I made book nullable in VocabularyBookStatistics.cs and upon change of this property I call Refresh() checking if book is null and if so resetting the counters to zero. This still involves manually setting the book property to null from the MainForm.cs. VocabularyBookStatistics cannot be made nullable in MainForm.cs as there is no direct reference from there. Is this what you meant by your change request?

jdelange22 commented 2 months ago

@daniel-lerch I changed the code to reset the counters in the Control itself from the MainForm's UnloadBook() function.