Exemplo n.º 1
0
 private void UpdateViewModelBasedOnSelection(IReadOnlyList <IBlog> blogFiles)
 {
     if (blogFiles.Count == 0)
     {
         return;
     }
     detailsViewModel = GetViewModel(blogFiles.Select(blog => blog.GetType()).Distinct().Count() < 2
         ? blogFiles.FirstOrDefault()
         : new Blog());
     shellService.DetailsView = DetailsViewModel.View;
     shellService.UpdateDetailsView();
 }
Exemplo n.º 2
0
        private void UpdateViewModelBasedOnSelection(IReadOnlyList <IBlog> blogFiles)
        {
            if (blogFiles.Count == 0)
            {
                return;
            }

            _detailsViewModel = GetViewModel(blogFiles.Count < 2
                ? blogFiles.FirstOrDefault()
                : new Blog());
            DetailsViewModelChanged?.Invoke(this, EventArgs.Empty);
            _shellService.DetailsView = DetailsViewModel.View;
            _shellService.UpdateDetailsView();
        }
Exemplo n.º 3
0
 private void UpdateViewModelBasedOnSelection(IReadOnlyList <IBlog> blogFiles)
 {
     if (blogFiles.Count == 0)
     {
         return;
     }
     if (blogFiles.Select(blog => blog.BlogType).Distinct().Count() < 2)
     {
         detailsViewModel = GetViewModel(blogFiles.FirstOrDefault().BlogType);
     }
     else
     {
         detailsViewModel = GetViewModel(BlogTypes.all);
     }
     shellService.DetailsView = DetailsViewModel.View;
     shellService.UpdateDetailsView();
 }