You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DatabaseManager/ViewModels/MainWindowViewModel.cs

48 lines
1.1 KiB

using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
namespace DatabaseManager.ViewModels
{
public class MainWindowViewModel : BindableBase
{
private readonly IRegionManager regionManager;
private string _title = "DatabaseManager";
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public MainWindowViewModel(IRegionManager regionManager)
{
this.regionManager = regionManager;
}
private DelegateCommand coverCommand;
public DelegateCommand CoverCommand => coverCommand ?? (coverCommand = new DelegateCommand(ExecuteCoverCommand));
private void ExecuteCoverCommand()
{
regionManager.RequestNavigate("ContentRegion", "Cover");
}
private DelegateCommand headerCommand;
public DelegateCommand HeaderCommand => headerCommand ?? (headerCommand = new DelegateCommand(ExecuteHeaderCommand));
private void ExecuteHeaderCommand()
{
regionManager.RequestNavigate("ContentRegion", "Header");
}
}
}