init
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics.HardwareList;
|
||||
using Prism.Ioc;
|
||||
using Prism.Events;
|
||||
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
namespace HardwareList
|
||||
{
|
||||
/// <inheritdoc cref="ISLICE6TreeView" />
|
||||
/// <summary>
|
||||
/// Interaction logic for SLICE6TreeView.xaml
|
||||
/// </summary>
|
||||
public partial class SLICE6TreeView : ISLICE6TreeView
|
||||
{
|
||||
public SLICE6TreeView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Remove_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(sender is Control control)) { return; }
|
||||
if (!(control.DataContext is ISLICE6TreeNode treeNode)) { return; }
|
||||
if (!(DataContext is IHardwareListViewModel vm)) { return; }
|
||||
|
||||
vm.UnAssociate(treeNode);
|
||||
var eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
|
||||
eventAggregator.GetEvent<DTS.Common.Events.PageModifiedEvent>().Publish(
|
||||
new DTS.Common.Events.PageModifiedArg(DTS.Common.Events.PageModifiedArg.Status.Modified, null));
|
||||
}
|
||||
|
||||
private void Add_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(sender is Control control)) { return; }
|
||||
if (!(DataContext is IHardwareListViewModel vm)) { return; }
|
||||
if (null == vm.SelectedSLICE6) { return; }
|
||||
var treeNode = vm.SelectedSLICE6;
|
||||
vm.Associate(treeNode);
|
||||
var eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
|
||||
eventAggregator.GetEvent<DTS.Common.Events.PageModifiedEvent>().Publish(
|
||||
new DTS.Common.Events.PageModifiedArg(DTS.Common.Events.PageModifiedArg.Status.Modified, null));
|
||||
}
|
||||
/// <summary>
|
||||
/// handles the click of the swap button in the view
|
||||
/// </summary>
|
||||
private void Swap_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!(sender is Control control)) { return; }
|
||||
if (!(DataContext is IHardwareListViewModel vm)) { return; }
|
||||
if (null == vm.SelectedSLICE6DB) { return; }
|
||||
vm.Associate(vm.SelectedSLICE6DB);
|
||||
var eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
|
||||
eventAggregator.GetEvent<DTS.Common.Events.PageModifiedEvent>().Publish(
|
||||
new DTS.Common.Events.PageModifiedArg(DTS.Common.Events.PageModifiedArg.Status.Modified, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user