Exemplo n.º 1
0
 /// <summary>
 /// Gets a new instance of <see cref="User"/>.
 /// </summary>
 /// <returns>An instance of <see cref="User"/>.</returns>
 User IUserRepository.GetNewUser()
 {
     return(new User()
     {
         //Roles =UserRole.Normal,
         SelectedAccent = AppearanceManager.GetApplicationAccent(),
         SelectedTheme = AppearanceManager.GetApplicationTheme(),
         Password = "******"
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the appearance of the application as per user prefernce.
        /// </summary>
        private void SetUserPreference()
        {
            string accent = AppData.LoggedInUser.SelectedAccent ?? AppearanceManager.GetApplicationAccent();
            string theme  = AppData.LoggedInUser.SelectedTheme ?? AppearanceManager.GetApplicationTheme();

            AppearanceManager.ChangeAccent(accent);
            AppearanceManager.ChangeTheme(theme);
            //Set the defaults in settings view too!
            SettingsView.SetDefaultSettings(AppearanceManager.GetApplicationTheme(), AppearanceManager.GetApplicationAccent());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes an instance of <see cref="SettingsViewModel"/>.
 /// </summary>
 /// <param name="messagingService">An implementation of <see cref="IMessagingService"/>.</param>
 /// <param name="userRepository"> </param>
 public SettingsViewModel(IMessagingService messagingService, IUserRepository userRepository)
 {
     if (null == messagingService)
     {
         throw new ArgumentNullException("messagingService");
     }
     if (userRepository == null)
     {
         throw new ArgumentNullException("userRepository");
     }
     _messagingService = messagingService;
     _userRepository   = userRepository;
     AccentColorlist   = new List <string>(AppearanceManager.GetAccentNames());
     ThemeColorlist    = new List <string>(AppearanceManager.GetThemeNames());
     _selectedAccent   = AppearanceManager.GetApplicationAccent();
     _selectedTheme    = AppearanceManager.GetApplicationTheme();
     //Initialize commands
     ChangePasswordCommand = new RelayCommand(ChangePassword, CanChangePassword);
 }