Exemplo n.º 1
0
        public LoginViewModel(
            ISettingsService settingsService = null,
            IOpenUrlService openUrlService   = null,
            IIdentityService identityService = null
            ) : base("Authentication")
        {
            this.settingsService = settingsService ?? Locator.Current.GetService <ISettingsService>();
            this.openUrlService  = openUrlService ?? Locator.Current.GetService <IOpenUrlService>();
            this.identityService = identityService ?? Locator.Current.GetService <IIdentityService>();

            userName = string.Empty;
            password = string.Empty;

            this.UserDialogResult = false;

            this.WhenAnyValue(x => x.IdentityServerUrl)
            .Subscribe(s => this.settingsService.IdentityServerUrl = s);

            // TODO: this.MockSignInCommand = ReactiveCommand.Create(async () => await MockSignInAsync());
            this.SignInCommand   = ReactiveCommand.Create(async() => await SignInAsync());
            this.RegisterCommand = ReactiveCommand.Create(Register);
            this.NavigateCommand = ReactiveCommand.Create <string>(async(url) => await NavigateAsync(url));
            //this.SettingsCommand = ReactiveCommand.Create(async () => await SettingsAsync());
            //this.ValidateUserNameCommand = ReactiveCommand.Create(() => ValidateUserName());
            //this.ValidatePasswordCommand = ReactiveCommand.Create(() => ValidatePassword());

            // InvalidateMock();
            // TODO: AddValidations();
        }
Exemplo n.º 2
0
        /// <summary>
        ///     ctor().
        /// </summary>
        public SignUpViewModel(IOpenUrlService openUrlService)
        {
            _openUrlService = openUrlService;

            ActionBarHeader = _SIGN_UP_HEADER;

            BackCommand = new Command(async() => {
                await NavigationService.GoBackAsync();
            });
        }
Exemplo n.º 3
0
        public LoginViewModel(IOpenUrlService openUrlService, IIdentityService identityService)
        {
            _openUrlService  = openUrlService;
            _identityService = identityService;

            _userName = new ValidatableObject <string>();
            _password = new ValidatableObject <string>();

            InvalidateMock();
            AddValidations();
        }
Exemplo n.º 4
0
        public LoginViewModel()
        {
            _settingsService = DependencyService.Get <ISettingsService> ();
            _openUrlService  = DependencyService.Get <IOpenUrlService> ();
            _identityService = DependencyService.Get <IIdentityService> ();

            _userName = new ValidatableObject <string>();
            _password = new ValidatableObject <string>();

            InvalidateMock();
            AddValidations();
        }
Exemplo n.º 5
0
        public LoginViewModel(
            ISettingsService settingsService,
            IDialogService dialogService,
            INavigationService <ViewModelBase> navigationService,
            IOpenUrlService openUrlService,
            IIdentityService identityService
            )
            : base(settingsService, dialogService, navigationService)
        {
            _openUrlService  = openUrlService;
            _identityService = identityService;

            _userName = new ValidatableObject <string>();
            _password = new ValidatableObject <string>();

            InvalidateMock();
            AddValidations();
        }
Exemplo n.º 6
0
        public Workspace(IOpenUrlService openUrlService = null, IDialogService dialogService = null, ISettingsService settingsService = null, IIdentityService identityService = null)
        {
            this.openUrlService  = openUrlService ?? Locator.Current.GetService <IOpenUrlService>();
            this.dialogService   = dialogService ?? Locator.Current.GetService <IDialogService>();
            this.settingsService = settingsService ?? Locator.Current.GetService <ISettingsService>();
            this.identityService = identityService ?? Locator.Current.GetService <IIdentityService>();

            this.newNeuronTreeCommand = ReactiveCommand.Create(() =>
            {
                this.panes.Add(new NeuronTreePaneViewModel());
                this.ActiveDocument = this.panes.Last();
            });

            this.newNotificationsCommand = ReactiveCommand.Create(() =>
            {
                this.panes.Add(new NotificationsPaneViewModel());
                this.ActiveDocument = this.panes.Last();
            });

            this.signInCommand = ReactiveCommand.Create <object>(async(parameter) =>
                                                                 await this.OnSignInClicked(parameter));

            this.openAboutCommand = ReactiveCommand.Create(() => this.openUrlService.OpenUrl("https://github.com/ei8/cortex-diary"));
        }
Exemplo n.º 7
0
 public OpenLinkCommand(IOpenUrlService openUrlService, IMessageBoxService messageBoxService)
 {
     OpenUrlService    = openUrlService;
     MessageBoxService = messageBoxService;
 }
Exemplo n.º 8
0
 public Task <bool?> ShowLogin(ISettingsService settingsService, IOpenUrlService openUrlService, IIdentityService identityService, object owner, out bool result)
 {
     return(this.ShowDialog <bool>(new LoginViewModel(settingsService, openUrlService, identityService), owner, out result, "Avatar Server Log In", 800, 630));
 }