public AccountManagementViewModel(AccountsManagementModel model, IUIVisualizerService uiVisualizerService, IPleaseWaitService pleaseWaitService, IMessageService messageService) { Accounts = model; _uiVisualizerService = uiVisualizerService; _pleaseWaitService = pleaseWaitService; _messageService = messageService; BanAccountCommand = new Command(BanAccount); UnbanAccountCommand = new Command(UnbanAccount); }
private async void AccountManagement() { List<AccountManagementModel> accountList = new List<AccountManagementModel>(); List<BannedAccount> accts = await TCManager.Instance.AuthDatabase.GetBannedAccounts(); foreach (var acct in accts) { var account = await TCManager.Instance.AuthDatabase.GetAccount(acct.Id); var ban = await TCManager.Instance.AuthDatabase.GetBannedAccount(acct.Id); accountList.Add(new AccountManagementModel(account.Username, ban.BanDate, ban.BanReason)); } AccountsManagementModel acctsModel = new AccountsManagementModel(accountList); _uiVisualizerService.ShowDialog(new AccountManagementViewModel(acctsModel, _uiVisualizerService, _pleaseWaitService, _messageService)); }