Beispiel #1
0
    public IOptionsViewModel CreateTemplate (Contracts.Options options, GeneralOptions generalOptions, ProfileType type)
    {
            IServerSettingsTemplateViewModel serverSettingsVM;
            if (IsGoogleProfile(options))
            {
                serverSettingsVM = (IServerSettingsTemplateViewModel)new GoogleServerSettingsTemplateViewModel(_outlookAccountPasswordProvider);
            }
            else if (IsSwisscomProfile(options))
            {
                serverSettingsVM = (IServerSettingsTemplateViewModel)new SwisscomServerSettingsTemplateViewModel(_outlookAccountPasswordProvider);
            }
            else
            {
                serverSettingsVM = new ServerSettingsTemplateViewModel(_outlookAccountPasswordProvider);
            }
            var optionsViewModel = new MultipleOptionsTemplateViewModel (
         _optionsViewModelParent,
         generalOptions,
         serverSettingsVM,
         type,
         _optionTasks);

      optionsViewModel.SetOptions (options);
      return optionsViewModel;
    }
Beispiel #2
0
 private void ServerSettingsView_DataContextChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
 {
     _viewModel = e.NewValue as ServerSettingsTemplateViewModel;
     if (_viewModel != null)
     {
         // Password is just a OneWayBinding. Therefore just set the initial value
         _passwordBox.Password = SecureStringUtility.ToUnsecureString(_viewModel.Password);
     }
 }