Inheritance: ReactiveUI.ReactiveObject
        public MainViewModel() {
            _userSettings = Locator.Current.GetService<UserSettings>();
            _disposable = new CompositeDisposable();

            Preferences = ReactiveCommand.Create(this.WhenAnyValue(x => x.PreferencesOpened, po => !po));
            Preferences.Subscribe(_ => PreferencesOpened = true);

            Refresh =
                ReactiveCommand.Create(this.WhenAnyValue(x => x._userSettings.ApiKey,
                    (a) => !String.IsNullOrWhiteSpace(a)));
            Refresh.Subscribe(_ => Droplets.Execute(null));

            Close = ReactiveCommand.Create();
            Droplets = ReactiveCommand.CreateAsyncObservable(_ => GetDroplets());
            Reboot = ReactiveCommand.CreateAsyncObservable(x => RebootDroplet((Droplet) x));
            PowerOff = ReactiveCommand.CreateAsyncObservable(x => PowerOffDroplet((Droplet) x));
            PowerOn = ReactiveCommand.CreateAsyncObservable(x => PowerOnDroplet((Droplet) x));

            RefreshDroplets();
        }
        public PreferencesViewModel() {
            Activator = new ViewModelActivator();
            _userSettings = Locator.Current.GetService<UserSettings>();
            _apiKey = _userSettings.ApiKey;
            _refreshInterval = _userSettings.RefreshInterval;

            this.WhenActivated(d => {
                d(Close = ReactiveCommand.Create());
                d(Closing = ReactiveCommand.Create());
                d(Save = ReactiveCommand.Create());

                d(Closing.Subscribe(_ => {
                    var vm = Locator.Current.GetService<MainViewModel>();
                    vm.PreferencesOpened = false;
                }));

                d(Save.Subscribe(_ => {
                    _userSettings.ApiKey = ApiKey;
                    _userSettings.RefreshInterval = RefreshInterval;
                    _userSettings.Save();
                    Close.Execute(null);
                }));
            });
        }