This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<base:BaseView x:Class="DTS.Viewer.NavigationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<!-- Display Notification Window -->
<!--<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<inf:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>-->
</i:Interaction.Triggers>
<base:BaseView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseView.Resources>
<ContentControl x:Name="NavigationRegion" Background="LightGray">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<controls:RoundedBox />
<Label>Navigation View</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</base:BaseView>

View File

@@ -0,0 +1,15 @@
using DTS.Common.Interface;
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for NavigationView.xaml
/// </summary>
public partial class NavigationView : INavigationView
{
public NavigationView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,161 @@
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 NavigationViewModel : BaseViewModel<INavigationViewModel>, INavigationViewModel
{
public INavigationView NavigationView { get; private set; }
private IShellViewModel Parent { get; set; }
private IEventAggregator EventAggregator { get; set; }
private IRegionManager _regionManager;
private IUnityContainer UnityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TechnologyDoFrontEditViewModel.
/// </summary>
/// <param name="view">The NavigationView View.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
NavigationView = view;
NavigationView.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
EventAggregator = eventAggregator;
UnityContainer = unityContainer;
_regionManager = regionManager;
EventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
}
public override void Initialize()
{
}
public override void Initialize(object parameter)
{
Parent = (IShellViewModel)parameter;
}
#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
});
}
/// <summary>
/// Get all regions in the view
/// </summary>
/// <returns></returns>
//public List<FrameworkElement> GetRegions()
//{
// var items = new List<FrameworkElement>();
// Utils.GetChildrenByName(((NavigationView)NavigationView).FrontShell, "Region", ref items);
// return items;
//}
#endregion
#region ContextRegion
public object ContextNavigationRegion
{
get { return ((NavigationView)NavigationView).NavigationRegion.Content; }
set { ((NavigationView)NavigationView).NavigationRegion.Content = value; OnPropertyChanged("ContextNavigationRegion"); }
}
#endregion
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
var eventHandler = PropertyChanged;
if (eventHandler != null)
{
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
#region Properties
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo
{
get { return "NavigationRegion"; }
}
#endregion
public new bool IsBusy
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public override void Activated()
{
throw new NotImplementedException();
}
public new bool IsDirty
{
get { throw new NotImplementedException(); }
}
public override void Cleanup()
{
throw new NotImplementedException();
}
public new Task CleanupAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync()
{
throw new NotImplementedException();
}
public override Task InitializeAsync(object parameter)
{
throw new NotImplementedException();
}
}
}