init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.DockPanelHorizontalView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
|
||||
<DockPanel MinWidth="1000" MinHeight="150">
|
||||
<ContentControl x:Name="MainTabRegion" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="150" MinWidth="1000">
|
||||
<ContentControl.Template>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<ContentPresenter Content="{TemplateBinding Content}" />
|
||||
</ControlTemplate>
|
||||
</ContentControl.Template>
|
||||
</ContentControl>
|
||||
</DockPanel>
|
||||
</base:BaseView>
|
||||
@@ -0,0 +1,16 @@
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for DockPanelHorizontal.xaml
|
||||
/// </summary>
|
||||
public partial class DockPanelHorizontalView : IDockPanelHorizontalView
|
||||
{
|
||||
public DockPanelHorizontalView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user