protected void SetAccounts(Conversion.Settings.Accounts accounts) { _accountsCollection = new Helper.SynchronizedCollection <DropboxAccount>(Accounts.DropboxAccounts); _accountsCollection.ObservableCollection.CollectionChanged += (sender, args) => RemoveDropboxAccountCommand.RaiseCanExecuteChanged(); RaisePropertyChanged(nameof(DropboxAccounts)); RemoveDropboxAccountCommand.RaiseCanExecuteChanged(); }
private void ConflateAllAccounts(PdfCreatorSettings settings) { _accounts = settings?.ApplicationSettings?.Accounts; if (_accounts == null) { return; } AllAccounts.Clear(); _accounts.SmtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.SmtpAccounts }); _accounts.DropboxAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.DropboxAccounts }); _accounts.FtpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.FtpAccounts }); _accounts.HttpAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.HttpAccounts }); _accounts.TimeServerAccounts.CollectionChanged += RaiseAddAccountsBelowVisibilityChanged; AllAccounts.Add(new CollectionContainer { Collection = _accounts.TimeServerAccounts }); RaisePropertyChanged(nameof(AllAccounts)); }