@@ -29,14 +29,12 @@ public MainViewModel(IThemeService themeService, IPageService _pageService, IDat
2929 {
3030 _themeService = themeService ;
3131 _themeService . ThemeChanged += ThemeChanged ;
32+ _themeService . IsLightTheme = _dataBase . isLightTheme ;
3233
3334 pageService = _pageService ;
3435 pageService . PageChanged += PageChanged ;
3536 pageService . PageRemoteChanged += PageRemoteChanged ;
3637
37- database = _dataBase ;
38- _themeService . IsLightTheme = database . isLightTheme ;
39-
4038 sideBarBtns = new ObservableCollection < SideBarBtnModel > ( ) ;
4139
4240 // there should be some kind of condition here
@@ -47,10 +45,10 @@ public MainViewModel(IThemeService themeService, IPageService _pageService, IDat
4745 sideBarBtns [ 0 ] . background = _themeService . IsLightTheme ? ColorCon . Convert ( "#FCFCFC" ) : ColorCon . Convert ( "#36393F" ) ;
4846
4947
50- Pages = new List < Object > ( ) { new HomeViewModel ( themeService , pageService , database ) ,
51- new AddViewModel ( themeService , pageService , database ) ,
52- new FavViewModel ( themeService , pageService , database ) ,
53- new SettingViewModel ( _themeService , database ) } ;
48+ Pages = new List < Object > ( ) { new HomeViewModel ( themeService , pageService , _dataBase ) ,
49+ new AddViewModel ( themeService , pageService , _dataBase ) ,
50+ new FavViewModel ( themeService , pageService , _dataBase ) ,
51+ new SettingViewModel ( _themeService , _dataBase ) } ;
5452 pageService . Page = Pages [ 0 ] ;
5553 }
5654
0 commit comments