Beispiel #1
0
        public LoginViewModel(
            ILoginCredentialsViewModel credentials,
            ILogin2FaViewModel twoFactor,
            IDelegatingTwoFactorChallengeHandler twoFactorHandler)
        {
            twoFactorHandler.SetViewModel(twoFactor);

            Content = credentials;
            Done    = credentials.Done;

            twoFactor.WhenAnyValue(x => x.TwoFactorType)
            .Subscribe(x =>
            {
                Content = x == TwoFactorType.None ?
                          (IDialogContentViewModel)credentials :
                          twoFactor;
            });
        }