I’m developing WPF Prism application using Unity container. The issue is: I have a ListBox, each element has it’s own ViewModel. In that element I need to select a location from a list of locations. List of locations is the same for all elements. How could I share this list in the parent ViewModel?
On the internet I googled that I may:
-
Use
RegionContext. But
it’s not right way (RegionContextcould serve only one object, but I have not only locations). -
Use
SharedService. But, by my opinion, this way is more suitable
for real-time data changing.
Is there the right way? Best practice
If your list is always going to be the same, I usually use a Static class
Then in my XAML