BOB/BaseFrame/ViewModels/MainViewModel.cs
2025-11-04 10:27:48 +08:00

85 lines
2.0 KiB
C#

using Common.PubEvent;
using Common.PubEvents;
using NLog;
using Prism.Dialogs;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Input;
namespace BaseFrame.ViewModels
{
public class MainViewModel : BindableBase,INavigationAware,IDialogAware
{
#region
#endregion
#region
public ICommand testcommand { get; set; }
#endregion
public DialogCloseListener RequestClose { get; set; }
private IEventAggregator _eventAggregator;
private IDialogService _dialogService;
public MainViewModel(IEventAggregator eventAggregator, IDialogService dialogService)
{
_dialogService = dialogService;
_eventAggregator = eventAggregator;
testcommand = new DelegateCommand(test);
}
private void test()
{
//_eventAggregator.GetEvent<OverlayEvent>().Publish(true);
//var parameters = new DialogParameters
//{
// { "Title", "提示" },
// { "Message", "操作成功!" },
// { "Icon", "info" },
// { "ShowOk", true }
//};
//_dialogService.ShowDialog("MessageBox",parameters);
}
#region
public void OnNavigatedTo(NavigationContext navigationContext)
{
}
public bool IsNavigationTarget(NavigationContext navigationContext)
{
return true;
}
public void OnNavigatedFrom(NavigationContext navigationContext)
{
}
#endregion
#region
public bool CanCloseDialog()
{
return true;
}
public void OnDialogClosed()
{
}
public void OnDialogOpened(IDialogParameters parameters)
{
}
#endregion
}
}