So I'm returning to desktop apps after a decade away in non-programming IT roles, and teaching myself C# and WPF. (Don't judge! I see the _reported_ downward trend :-)
So here's my problem: I have a hierarchical parent C# object that I'd like to use as my over-arching data source. Let's say it has an ObservableCollection of Person objects. And each Person object in the collection has an ObservableCollection of Tags (simple objects that have a name, description, color). This is so that an application user can "tag" a person with such things as "Manager" or "Employee" tags (and other custom tags they create).
When an individual Tag object is created, I assign a new Guid (converted to string) to an ID property on the Tag. Instead of storing an actual Tag object in the Tags collection of each Person (to avoid unnecessary data bloat), I was going to store the ID property value (guid string) in the Person.Tags collection.
Problem is, now when it comes to data binding, is there an easy path to display a Person and their tags (and allow editing of tags)?
One possible solution that I've thought of is once the parent object is recreated from disk (deserialized), create a temporary ObservableCollection of Tags (actual Tag objects instead of guid strings) for each Person and bind to that. Other thoughts appreciated.
BTW, I'm really surprised that WPF has made it this far. When you take the intersection of out-of-the-can objects that are actually compatible with real-world use, it's a tiny, tiny set. For example, objects that can be used for databinding and serialized without heavy code writing and workarounds.
What I have tried:
Not worrying about data bloat and just go for it.