{
if (_mainViewModel == null)
{
- _mainViewModel = new MainViewModel();
+ _mainViewModel = new MainViewModel(new SettingsViewModel());
}
DataContext = _mainViewModel;
{
if (_selectedDateViewModel == null)
{
- _selectedDateViewModel = new SelectedDateViewModel();
+ _selectedDateViewModel = new SelectedDateViewModel(new SettingsViewModel());
}
DataContext = _selectedDateViewModel;
{
private readonly SettingsViewModel _settings;
- public MainViewModel()
+ public MainViewModel(SettingsViewModel settings)
{
this.ForecastItems = new ObservableCollection<ItemViewModel>();
this.CurrentItems = new ObservableCollection<ItemViewModel>();
// Get the _settings for this application.
- _settings = new SettingsViewModel();
+ _settings = settings;
}
/// <summary>
{
public class SelectedDateViewModel : INotifyPropertyChanged
{
- private readonly SettingsViewModel _settings = new SettingsViewModel();
+ private readonly SettingsViewModel _settings;
+ public SelectedDateViewModel(SettingsViewModel settings)
+ {
+ _settings = settings;
+ }
public String TitleTextCityCountry { get; private set; }