Big redesign (closer to Win10 UWP)

Replaced breadcrumb with Up button
Search button now integrated in top menu
Hamburger menu make better use of visual states
Better visual states changes when size changes
This commit is contained in:
Geoffroy BONNEVILLE
2020-05-04 20:56:19 +02:00
parent b3c7683c12
commit 2f30389f6c
15 changed files with 378 additions and 296 deletions

View File

@@ -1,19 +1,46 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using GalaSoft.MvvmLight.Views;
using MediatR;
using ModernKeePass.Application.Database.Models;
using ModernKeePass.Application.Database.Queries.GetDatabase;
using ModernKeePass.Application.Entry.Models;
using ModernKeePass.Application.Group.Models;
using ModernKeePass.Application.Group.Queries.GetAllGroups;
using ModernKeePass.Application.Group.Queries.SearchEntries;
using ModernKeePass.Common;
using ModernKeePass.Models;
namespace ModernKeePass.ViewModels
{
public class TopMenuVm
{
private readonly IMediator _mediator;
private readonly INavigationService _navigation;
private readonly DatabaseVm _database;
public IEnumerable<GroupVm> Groups { get; set; }
public TopMenuVm(IMediator mediator)
public TopMenuVm(IMediator mediator, INavigationService navigation)
{
var database = mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
Groups = mediator.Send(new GetAllGroupsQuery { GroupId = database.RootGroupId }).GetAwaiter().GetResult();
_mediator = mediator;
_navigation = navigation;
_database = _mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
Groups = _mediator.Send(new GetAllGroupsQuery { GroupId = _database.RootGroupId }).GetAwaiter().GetResult();
}
public void GoToEntry(string entryId, bool isNew = false)
{
_navigation.NavigateTo(Constants.Navigation.EntryPage, new NavigationItem
{
Id = entryId,
IsNew = isNew
});
}
public async Task<IEnumerable<EntryVm>> Search(string queryText)
{
return await _mediator.Send(new SearchEntriesQuery { GroupId = _database.RootGroupId, SearchText = queryText });
}
}
}