示例#1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public SettingsViewModel()
        {
            // Create First Name
            FirstName = new TextEntryViewModel
            {
                Label        = "First Name",
                OriginalText = mLoadingText,
                CommitAction = SaveFirstNameAsync
            };

            // Create Last Name
            LastName = new TextEntryViewModel
            {
                Label        = "Last Name",
                OriginalText = mLoadingText,
                CommitAction = SaveLastNameAsync
            };

            // Create Username
            Username = new TextEntryViewModel
            {
                Label        = "Username",
                OriginalText = mLoadingText,
                CommitAction = SaveUsernameAsync
            };

            // Create Password
            Password = new PasswordEntryViewModel
            {
                Label        = "Password",
                FakePassword = "******",
                CommitAction = SavePasswordAsync
            };

            // Create Email
            Email = new TextEntryViewModel
            {
                Label        = "Email",
                OriginalText = mLoadingText,
                CommitAction = SaveEmailAsync
            };

            // Create commands
            OpenCommand          = new RelayCommand(Open);
            CloseCommand         = new RelayCommand(Close);
            LogoutCommand        = new RelayCommand(async() => await LogoutAsync());
            ClearUserDataCommand = new RelayCommand(ClearUserData);
            LoadCommand          = new RelayCommand(async() => await LoadAsync());
            SaveFirstNameCommand = new RelayCommand(async() => await SaveFirstNameAsync());
            SaveLastNameCommand  = new RelayCommand(async() => await SaveLastNameAsync());
            SaveUsernameCommand  = new RelayCommand(async() => await SaveUsernameAsync());
            SaveEmailCommand     = new RelayCommand(async() => await SaveEmailAsync());

            // TODO: Get from localization
            LogoutButtonText = "Logout";
        }
示例#2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public SettingsDesignModel()
 {
     FirstName = new TextEntryViewModel {
         Label = "Fist Name", OriginalText = "Luke"
     };
     LastName = new TextEntryViewModel {
         Label = "Last Name", OriginalText = "Malpass"
     };
     Username = new TextEntryViewModel {
         Label = "Username", OriginalText = "luke"
     };
     Password = new PasswordEntryViewModel {
         Label = "Password", FakePassword = "******"
     };
     Email = new TextEntryViewModel {
         Label = "Email", OriginalText = "*****@*****.**"
     };
 }