106 lines
3.7 KiB
Plaintext
106 lines
3.7 KiB
Plaintext
using System;
|
|
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using DTS.Common.Base;
|
|
using DTS.Common.Events;
|
|
using DTS.Common.Interface;
|
|
using Microsoft.Practices.Prism.Events;
|
|
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
|
|
using Microsoft.Practices.Prism.Regions;
|
|
using Microsoft.Practices.Unity;
|
|
|
|
namespace DTS.Viewer
|
|
{
|
|
public class DockPanelHorizontalViewModel : BaseViewModel<IDockPanelHorizontalViewModel>, IDockPanelHorizontalViewModel
|
|
{
|
|
public IDockPanelHorizontalView View { get; private set; }
|
|
private IViewModel Parent { get; set; }
|
|
private IEventAggregator EventAggregator { get; set; }
|
|
private new IRegionManager _regionManager;
|
|
private IUnityContainer UnityContainer { get; set; }
|
|
|
|
public InteractionRequest<Notification> NotificationRequest { get; private set; }
|
|
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
|
|
|
|
#region Properties
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
public bool IsMenuIncluded { get; set; }
|
|
public bool IsNavigationIncluded { get; set; }
|
|
public bool IsBusy { get; set; }
|
|
public bool IsDirty { get; private set; }
|
|
|
|
public DockPanelHorizontalViewModel(IDockPanelHorizontalView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
|
|
: base(regionManager, eventAggregator, unityContainer)
|
|
{
|
|
View = view;
|
|
View.DataContext = this;
|
|
NotificationRequest = new InteractionRequest<Notification>();
|
|
ConfirmationRequest = new InteractionRequest<Confirmation>();
|
|
|
|
EventAggregator = eventAggregator;
|
|
UnityContainer = unityContainer;
|
|
_regionManager = regionManager;
|
|
EventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
|
|
}
|
|
#endregion Properties
|
|
|
|
#region Methods
|
|
|
|
/// <summary>
|
|
/// Private Event handler for RaiseNotification event.
|
|
/// </summary>
|
|
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
|
|
{
|
|
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
|
|
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
|
|
NotificationRequest.Raise(new Notification { Content = eventArgsWithoutTitle, Title = eventArgsWithTitle.Title });
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void Initialize(object parameter)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void Activated()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
public override void Cleanup()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public new Task CleanupAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public new void Initialize(object parameter, object model)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override Task InitializeAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override Task InitializeAsync(object parameter)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
#endregion Methods
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|