示例#1
0
 private void NavigateTo <TViewModel>() where TViewModel : IViewModel
 {
     if (_openedWindows.Contains(typeof(TViewModel).Name))
     {
         _messageDialog.ShowError(
             title: General.AttentionTitle,
             message: General.CannotOpenWindowsTwice);
         return;
     }
     _openedWindows.Add(typeof(TViewModel).Name);
     _viewNavigator.Open <TViewModel>();
 }
示例#2
0
        public async Task Load()
        {
            try
            {
                this.Loading = true;
                var users = await _roleRepository.GetAll();

                var mappedRoles = users.Select(_mapper.Map <RoleListItemDto>).ToList();
                ApplicationDispatcher.Invoke(() => Roles.AddRange(mappedRoles));
            }
            catch (Exception ex)
            {
                _messageDialog.ShowError(title: General.ErrorLoadingRolesTitle, message: ex.Message);
            }
            finally
            {
                this.Loading = false;
            }
        }