public SettingsViewModel(INavigation navigation)
 {
     _navigation        = navigation;
     util               = new Utils();
     SynchCommand       = new Command(async() => await Synchrun());
     _synchmanager      = new SynchManager();
     databasehelper     = new DatabaseHelper();
     ChangeThemeCommand = new Command((x) =>
     {
         if (SelectedTheme.ToLower() == "dark")
         {
             Application.Current.Resources = new DarkTheme();
         }
         else
         {
             Application.Current.Resources = new LightTheme();
         }
         App.AppTheme = SelectedTheme.ToLower();
     });
     if (!IsSynchBusy)
     {
         IsSynchEnabled = true;
     }
     FetchSettings();
 }
Esempio n. 2
0
 public PlotSynchViewModel(INavigation navigation)
 {
     util              = new Utils();
     _navigation       = navigation;
     _databasehelper   = new DatabaseHelper();
     _synchmanager     = new SynchManager();
     databasehelper    = new DatabaseHelper();
     ListPlots         = Services.PickerService.FillPlotPicker(databasehelper.GetAllPlotData()).ToList().OrderBy(c => c.NAME).ToList();
     SynchPlotCommand  = new Command <PLOT>(async(x) => await SynchPlotrun(x));
     SinglePlotCommand = new Command(async() => await SynchPlotrun());
     SynchCommand      = new Command(async() => await Synchrun());
     if (!IsSynchBusy)
     {
         IsSynchEnabled = true;
     }
     _plotlist = new ObservableCollection <PLOT>(databasehelper.GetPlotDataforSynch(System.DateTime.MinValue).ToList());
     //FetchPlots();
     //   MessagingCenter.Subscribe<PlotSynchList>(this, "Update listview", (sender) =>
     //   {
     //       FetchPlots();
     //   });
 }