init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace DTS.Common.Enums.Sensors.SensorsList
|
||||
{
|
||||
public enum DigitalOutFields
|
||||
{
|
||||
Included,
|
||||
SerialNumber,
|
||||
Description,
|
||||
Delay,
|
||||
Duration,
|
||||
ModifiedBy,
|
||||
LastModified
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace DTS.Common.Interface.Channels
|
||||
{
|
||||
public interface IChannelSettingRecord
|
||||
{
|
||||
int Id { get; set; }
|
||||
string SettingName { get; set; }
|
||||
string DefaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 502 B |
@@ -0,0 +1,23 @@
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Event to inform app that a page name had been updated
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
public class PageNameEvent : CompositePresentationEvent<PageNameEventArg> { }
|
||||
|
||||
public class PageNameEventArg
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public object Page { get; private set; }
|
||||
public PageNameEventArg(object page, string name)
|
||||
{
|
||||
Page = page;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
using Microsoft.Windows.Controls.Ribbon;
|
||||
|
||||
namespace DTS.Common.RibbonControl
|
||||
{
|
||||
public class RibbonControlSelectionChangeBehavior : System.Windows.Interactivity.Behavior<Ribbon>
|
||||
{
|
||||
public static readonly DependencyProperty TargetRibbonProperty = DependencyProperty.Register("TargetRibbonControl", typeof(Ribbon), typeof(RibbonControlSelectionChangeBehavior), new PropertyMetadata(null));
|
||||
|
||||
private IEventAggregator _eventAggregator;
|
||||
|
||||
public Ribbon TargetRibbonControl
|
||||
{
|
||||
get => (Ribbon)GetValue(TargetRibbonProperty);
|
||||
set => SetValue(TargetRibbonProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
AssociatedObject.SelectionChanged += Ribbon_SelectionChanged;
|
||||
|
||||
if (_eventAggregator == null)
|
||||
_eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
|
||||
}
|
||||
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
base.OnDetaching();
|
||||
AssociatedObject.SelectionChanged -= Ribbon_SelectionChanged;
|
||||
}
|
||||
|
||||
void Ribbon_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count > 0)
|
||||
_eventAggregator.GetEvent<RibbonControlSelectionChanged>().Publish(new RibbonControlSelectionEventArgs(RibbonControlOperation.AddedItem, e.AddedItems[0]));
|
||||
|
||||
if (e.RemovedItems.Count > 0)
|
||||
_eventAggregator.GetEvent<RibbonControlSelectionChanged>().Publish(new RibbonControlSelectionEventArgs(RibbonControlOperation.RemovedItem, e.RemovedItems[0]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 390 B |
Reference in New Issue
Block a user