I am fairly new to Xamarin. I'm currently working on a project and am trying to use best MVVM practices in building it. I've successfully implemented the MVVM pattern for my login page and I have a pretty good grasp on that, but it is a little more straight forward than what I'm trying to do now.
Once you log in you're brought to a TabbedPage. The TabbedPage contains two ContentPages, one with a ListView. My goal is to create an ObservableCollection which can be accessed by both of the ContentPages in the TabbedPage but I'm not sure where the correct place to create this ObservableCollection would be.
Should I create a ViewModel for the TabbedPage and have the ObservableList live there and have the ViewModels for the two ContentPages access that ViewModel? Should I create the ObservableList in the ViewModel of the first ContentPage with the ListView and have the second ContentPage reference that ViewModel?
I've tried looking for resources to understand this particular scenario but I haven't been able to find any that discuss multiple views referencing the same ObservableList. I'd be very grateful for either an explanation on the best way to do this, or a link to a resource that would explain or exemplify this. Thanks!
I should also note that I currently have the ObservableList living in the code behind for the ContentPage with the ListView. I know this is not where it should be but I just wanted to make sure I could get the ListView working with an ObservableList and I am now looking to move it to where it should be.