1- using Genesis . Ensure ;
2- using ReactiveUI ;
3- using System ;
1+ using System ;
42using System . Reactive ;
53using System . Reactive . Concurrency ;
64using System . Reactive . Linq ;
75using System . Threading ;
86using System . Threading . Tasks ;
7+ using Genesis . Ensure ;
8+ using ReactiveUI ;
99
1010namespace IntegrationTests . Shared
1111{
12+ /// <summary>
13+ /// View model for login functionality.
14+ /// </summary>
15+ /// <seealso cref="ReactiveUI.ReactiveObject" />
1216 public class LoginViewModel : ReactiveObject
1317 {
1418 private string _userName ;
1519 private string _password ;
1620 private IScheduler _mainScheduler ;
1721
22+ /// <summary>
23+ /// Initializes a new instance of the <see cref="LoginViewModel"/> class.
24+ /// </summary>
25+ /// <param name="mainScheduler">The main scheduler.</param>
1826 public LoginViewModel ( IScheduler mainScheduler )
1927 {
2028 Ensure . ArgumentNotNull ( mainScheduler , nameof ( mainScheduler ) ) ;
@@ -25,8 +33,7 @@ public LoginViewModel(IScheduler mainScheduler)
2533 . WhenAnyValue (
2634 vm => vm . UserName ,
2735 vm => vm . Password ,
28- ( user , password ) => ! string . IsNullOrWhiteSpace ( user ) && ! string . IsNullOrWhiteSpace ( password )
29- ) ;
36+ ( user , password ) => ! string . IsNullOrWhiteSpace ( user ) && ! string . IsNullOrWhiteSpace ( password ) ) ;
3037
3138 Login = ReactiveCommand . CreateFromObservable (
3239 ( ) =>
@@ -38,16 +45,28 @@ public LoginViewModel(IScheduler mainScheduler)
3845 Cancel = ReactiveCommand . Create ( ( ) => { } , Login . IsExecuting , _mainScheduler ) ;
3946 }
4047
48+ /// <summary>
49+ /// Gets the login command.
50+ /// </summary>
4151 public ReactiveCommand < Unit , bool ? > Login { get ; }
4252
53+ /// <summary>
54+ /// Gets the cancel command.
55+ /// </summary>
4356 public ReactiveCommand < Unit , Unit > Cancel { get ; }
4457
58+ /// <summary>
59+ /// Gets or sets the name of the user.
60+ /// </summary>
4561 public string UserName
4662 {
4763 get => _userName ;
4864 set => this . RaiseAndSetIfChanged ( ref _userName , value ) ;
4965 }
5066
67+ /// <summary>
68+ /// Gets or sets the password.
69+ /// </summary>
5170 public string Password
5271 {
5372 get => _password ;
0 commit comments