public DailyDataViewModel(Core.SunnyPortal service)
 {
     sunnyPortal = service;
     Messenger.Default.Register <Messages>(this, (x) =>
     {
         if (x == Messages.IsLoggedIn)
         {
             LoadPoints();
         }
     });
 }
Exemple #2
0
        public MainViewModel(Core.SunnyPortal sunnyPortal)
        {
            this.sunnyPortal       = sunnyPortal;
            this.CanUserConnecting = true;

            Messenger.Default.Register <Messages>(this, (x) =>
            {
                if (x == Messages.IsLoggedIn)
                {
                    HandleMessage();
                }
            });
        }
Exemple #3
0
        public LiveDataModel(Core.SunnyPortal service)
        {
            sunnyPortal = service;

            timer           = new Timer(10000);
            timer.Elapsed  += Timer_Elapsed;
            timer.AutoReset = true;

            Messenger.Default.Register <Messages>(this, async(x) =>
            {
                if (x == Messages.IsLoggedIn)
                {
                    this.CurrentPower = await sunnyPortal.GetCurrentPower();
                    this.timer.Start();
                }
            });
        }
 public LoginViewModel(Core.SunnyPortal sunnyPortal)
 {
     this.sunnyPortal = sunnyPortal;
 }