public MainViewModel(ApiConnectionService api, VarsService varsService, AccountsService accountsService) { _api = api; _varsService = varsService; InitCommands(); Accounts = accountsService .GetAccounts() .Select(a => new AccountViewModel( a, new Command(() => { api.UseStoredAccount(a.ID); CurrentAccount = a; }))) .ToArray(); CurrentAccount = accountsService.GetCurrentAccount(); }
public AccountsService(LocalDBFactory dbFactory, VarsService varsService) { _dbFactory = dbFactory; _varsService = varsService; }