Пример #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public SettingsViewModel()
        {
            // Create commands
            OpenCommand          = new RelayCommand(Open);
            CloseCommand         = new RelayCommand(Close);
            LogoutCommand        = new RelayCommand(Logout);
            ClearUserDataCommand = new RelayCommand(ClearUserData);

            // TODO: Remove this once th real back-end is ready
            Name = new TextEntryViewModel {
                Label = "Name", OriginalText = $"Luke Malpass"
            };
            Username = new TextEntryViewModel {
                Label = "Username", OriginalText = "luke"
            };
            Password = new PasswordEntryViewModel {
                Label = "Password", FakePassword = "******"
            };
            Email = new TextEntryViewModel {
                Label = "Email", OriginalText = "*****@*****.**"
            };

            // TODO: Get from localization
            LogoutButtonText = "Logout";
        }
Пример #2
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 Command(Open);
            CloseCommand         = new Command(Close);
            LogoutCommand        = new Command(async() => await LogoutAsync());
            ClearUserDataCommand = new Command(ClearUserData);
            LoadCommand          = new Command(async() => await LoadAsync());
            //SaveFirstNameCommand = new Command(async () => await SaveFirstNameAsync());
            //SaveLastNameCommand = new Command(async () => await SaveLastNameAsync());
            //SaveUsernameCommand = new Command(async () => await SaveUsernameAsync());
            //SaveEmailCommand = new Command(async () => await SaveEmailAsync());

            // TODO: Get from localization
            LogoutButtonText = "Logout";
        }
Пример #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public SettingsDesignModel()
 {
     Name = new TextEntryViewModel {
         Label = "Name", OriginalText = "Luke Malpass"
     };
     Username = new TextEntryViewModel {
         Label = "Username", OriginalText = "luke"
     };
     Password = new PasswordEntryViewModel {
         Label = "Password", FakePassword = "******"
     };
     Email = new TextEntryViewModel {
         Label = "Email", OriginalText = "*****@*****.**"
     };
 }
Пример #4
0
 public SettingsDesignModel()
 {
     Name = new TextEntryViewModel {
         Label = "Name", OriginalText = "Eli Schwarz"
     };
     Username = new TextEntryViewModel {
         Label = "Username", OriginalText = "eschwarz"
     };
     Password = new PasswordEntryViewModel {
         Label = "Password", FakePassword = "******"
     };
     Email = new TextEntryViewModel {
         Label = "Email", OriginalText = "*****@*****.**"
     };
 }
 /// <summary>
 /// default constructor
 /// </summary>
 public SettingsDesignModel()
 {
     Name = new TextEntryViewModel {
         Label = "Name", OriginalText = "Pielkop Cain"
     };
     Username = new TextEntryViewModel {
         Label = "Username", OriginalText = "pielkop"
     };
     Password = new PasswordEntryViewModel {
         Label = "Password", FakePassword = "******"
     };
     Email = new TextEntryViewModel {
         Label = "Email", OriginalText = "*****@*****.**"
     };
 }
Пример #6
0
 /// <summary>
 /// Default cinstructor
 /// </summary>
 public SettingsDesignModel()
 {
     FirstName = new TextEntryViewModel {
         Label = "First Name", OriginalText = "Igor"
     };
     LastName = new TextEntryViewModel {
         Label = "Last Name", OriginalText = "Feoktistov"
     };
     Username = new TextEntryViewModel {
         Label = "Username", OriginalText = "ifdev"
     };
     Password = new PasswordEntryViewModel {
         Label = "Password", FakePassword = "******"
     };
     Email = new TextEntryViewModel {
         Label = "Email", OriginalText = "*****@*****.**"
     };
 }
Пример #7
0
        /// <summary>
        /// Sets the settings view model properties based on the data in the client data store
        /// </summary>
        public async Task LoadAsync()
        {
            // Get the stored credentials
            var storedCredentials = await IoC.ClientDataStore.GetLoginCredentialsAsync();

            Name = new TextEntryViewModel {
                Label = "Name", OriginalText = $"{storedCredentials?.FirstName} {storedCredentials?.LastName}"
            };
            Username = new TextEntryViewModel {
                Label = "Username", OriginalText = storedCredentials?.Username
            };
            Password = new PasswordEntryViewModel {
                Label = "Password", FakePassword = "******"
            };
            Email = new TextEntryViewModel {
                Label = "Email", OriginalText = storedCredentials?.Email
            };
        }
Пример #8
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public SettingsViewModel()
        {
            // Create commands
            CloseCommand = new RelayCommand(Close);
            OpenCommand  = new RelayCommand(Open);

            // TODO: Remove this with real information pulled from our database in future
            Name = new TextEntryViewModel {
                Label = "Name", OriginalText = "Luke Malpass"
            };
            Username = new TextEntryViewModel {
                Label = "Username", OriginalText = "luke"
            };
            Password = new TextEntryViewModel {
                Label = "Password", OriginalText = "********"
            };
            Email = new TextEntryViewModel {
                Label = "Email", OriginalText = "*****@*****.**"
            };
        }
Пример #9
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public SettingsViewModel()
        {
            // Create FirstName
            FirstName = new TextEntryViewModel
            {
                Label        = "First Name",
                OriginalText = mLoadingText,
                CommitAction = SaveFirstNameAsync
            };

            // Create LastName
            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 Logout());
            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());

            //Name = new TextEntryViewModel { Label = "Name", OriginalText = $"Igor Feoktistov" };
            //Username = new TextEntryViewModel { Label = "Username", OriginalText = "Igor" };
            //Password = new PasswordEntryViewModel { Label = "Password", FakePassword = "******" };
            //Email = new TextEntryViewModel { Label = "Email", OriginalText = "*****@*****.**" };

            // TODO: Get from localization
            LogoutButtonText = "Logout";
        }