/// <summary> /// Initializes a new instance of the <see cref="RestfulViewModel"/> class. /// </summary> /// <param name="eventAggregator">The event aggregator.</param> /// <param name="container">The Prism Unity container.</param> public RestfulViewModel(IEventAggregator eventAggregator, IUnityContainer container) { _eventAggregator = eventAggregator; _container = container; _currentSugarCrmAccount = new SugarCrmAccount(); Application.Current.Properties["SugarCrmAccount"] = _currentSugarCrmAccount; UrlSelectionChangedCommand = new RelayCommand(UrlSelectionChanged); CredentialSelectionChangedCommand = new RelayCommand(CredentialSelectionChanged); DeleteUrlCommand = new RelayCommand(DeleteUrl, CanDeleteUrl); AddUrlCommand = new RelayCommand(AddUrl); DeleteCredentialCommand = new RelayCommand(DeleteCredential, CanDeleteCredential); AddCredentialCommand = new RelayCommand(AddCredential); GridRowType = EnumOptionType.Two; GetModuleInfoList(); LoadDefaultSugarCrmAccounts(); Validator = new RestfulViewModelValidator(this); }
/// <summary> /// Updates current account. /// </summary> /// <param name="sugarCrmAccount">The account opject to update.</param> private void UpdateCurrentAccount(SugarCrmAccount sugarCrmAccount) { CurrentSugarCrmAccount = sugarCrmAccount; Application.Current.Properties["SugarCrmAccount"] = CurrentSugarCrmAccount; }