mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Moved application code to the Application layer
Imported Win10 project Code cleanup WIP - Use common UWP services for Win8.1 and Win10
This commit is contained in:
30
ModernKeePass10/ViewModels/MainViewModel.cs
Normal file
30
ModernKeePass10/ViewModels/MainViewModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Windows.Storage;
|
||||
using Autofac;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
namespace ModernKeePass.ViewModels
|
||||
{
|
||||
public class MainViewModel
|
||||
{
|
||||
private readonly IDatabaseService _databaseService;
|
||||
private readonly IRecentService _recentService;
|
||||
|
||||
public bool IsDatabaseOpened => _databaseService.IsOpen;
|
||||
public bool HasRecentItems => _recentService.HasEntries;
|
||||
|
||||
public string OpenedDatabaseName => _databaseService.Name;
|
||||
public IStorageFile File { get; set; }
|
||||
|
||||
public MainViewModel()
|
||||
{
|
||||
_databaseService = App.Container.Resolve<IDatabaseService>();
|
||||
_recentService = App.Container.Resolve<IRecentService>();
|
||||
}
|
||||
|
||||
public MainViewModel(IDatabaseService databaseService, IRecentService recentService)
|
||||
{
|
||||
_databaseService = databaseService;
|
||||
_recentService = recentService;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user