public TraktDialogViewModel(ITraktService traktService)
        {
            _traktService = traktService;
            CloseCommand  = new RelayCommand(() =>
            {
                CloseAction.Invoke();
            });

            InitializeAsyncCommand = new RelayCommand(async() =>
            {
                try
                {
                    IsLoading     = true;
                    IsLoggedIn    = await _traktService.IsLoggedIn();
                    TraktOAuthUrl = !IsLoggedIn ? _traktService.GetAuthorizationUrl() : string.Empty;
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
                finally
                {
                    IsLoading = false;
                }
            });
        }
Beispiel #2
0
        public TraktDialogViewModel()
        {
            _traktService = new TraktService();
            CloseCommand  = new RelayCommand(() =>
            {
                CloseAction.Invoke();
            });

            InitializeAsyncCommand = new RelayCommand(async() =>
            {
                IsLoading     = true;
                IsLoggedIn    = await _traktService.IsLoggedIn();
                IsLoading     = false;
                TraktOAuthUrl = !IsLoggedIn ? _traktService.GetAuthorizationUrl() : string.Empty;
            });
        }