mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Finally a nicer looking and working TextBoxWithButton (inspired from the SearchButton)
SearchBox field style improved
This commit is contained in:
20
WinAppCommon/ViewModels/UserControls/TopMenuVm.cs
Normal file
20
WinAppCommon/ViewModels/UserControls/TopMenuVm.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Database.Queries.GetDatabase;
|
||||
using ModernKeePass.Application.Group.Models;
|
||||
using ModernKeePass.Application.Group.Queries.GetAllGroups;
|
||||
|
||||
namespace ModernKeePass.ViewModels
|
||||
{
|
||||
public class TopMenuVm
|
||||
{
|
||||
public IEnumerable<GroupVm> Groups { get; set; }
|
||||
public string SelectedDestinationGroup { get; set; }
|
||||
|
||||
public TopMenuVm(IMediator mediator)
|
||||
{
|
||||
var database = mediator.Send(new GetDatabaseQuery()).GetAwaiter().GetResult();
|
||||
Groups = mediator.Send(new GetAllGroupsQuery { GroupId = database.RootGroupId }).GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
}
|
@@ -63,6 +63,7 @@ namespace ModernKeePass.ViewModels
|
||||
SimpleIoc.Default.Register<SettingsSecurityVm>();
|
||||
SimpleIoc.Default.Register<OpenDatabaseControlVm>();
|
||||
SimpleIoc.Default.Register<SetCredentialsVm>();
|
||||
SimpleIoc.Default.Register<TopMenuVm>();
|
||||
SimpleIoc.Default.Register<MainVm>();
|
||||
SimpleIoc.Default.Register<NewVm>();
|
||||
SimpleIoc.Default.Register<OpenVm>();
|
||||
@@ -80,6 +81,7 @@ namespace ModernKeePass.ViewModels
|
||||
public SettingsSecurityVm SettingsSecurity => ServiceLocator.Current.GetInstance<SettingsSecurityVm>(Guid.NewGuid().ToString());
|
||||
public OpenDatabaseControlVm OpenDatabaseControl => ServiceLocator.Current.GetInstance<OpenDatabaseControlVm>(Guid.NewGuid().ToString());
|
||||
public SetCredentialsVm SetCredentials => ServiceLocator.Current.GetInstance<SetCredentialsVm>(Guid.NewGuid().ToString());
|
||||
public TopMenuVm TopMenu => ServiceLocator.Current.GetInstance<TopMenuVm>(Guid.NewGuid().ToString());
|
||||
public NewVm New => ServiceLocator.Current.GetInstance<NewVm>(Guid.NewGuid().ToString());
|
||||
public OpenVm Open => ServiceLocator.Current.GetInstance<OpenVm>(Guid.NewGuid().ToString());
|
||||
public RecentVm Recent => ServiceLocator.Current.GetInstance<RecentVm>(Guid.NewGuid().ToString());
|
||||
|
Reference in New Issue
Block a user