How to create global data in WPF project using MVVM

139 views Asked by At

I'm working on building a project using WPF but I don't know how to store data which can be used in multiple places in the app. In the Homepage.xaml file, I import 3 other xaml files. Each of these files associated with one viewModel file. When the Homepage is displayed on the UI, the calendar will show today date, and the action items in the view3 will have Today's data (which I will be fetching from an API). Then when user chooses another date, the calendar date also change, as well as API call is performed and the action items will also change accordingly. So my question is where should I store the data from API calls and how to update the view3 UI? My assumption is to fetch the data in HomepageViewModel.cs and somehow pass them to view1.cs and view3.cs but I don't know if it's right and how I can do it. I'm very new to WPF and MVVM and no one in my company can help because no one knows about the tool.[Here is the UI that I will be building]

I have been watching tutorials and read some document online but I really don't know where to start and how to achieve what I intend to do. I appreciate any help. Thanks so much

0

There are 0 answers