init
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using DTS.Common.Enums.Communication;
|
||||
|
||||
namespace DTS.Common.Interface.Communication
|
||||
{
|
||||
public interface ICommunicationReport
|
||||
{
|
||||
object UserState { get; set; }
|
||||
CommunicationConstantsAndEnums.CommunicationResult Result { get; set; }
|
||||
byte[] Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace DTS.Common.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the base class for views that define the appearance of data in a UserControl control.
|
||||
/// </summary>
|
||||
///
|
||||
public class BaseView : UserControl, IBaseView
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the bound object data data has been changed (View is dirty).
|
||||
/// </summary>
|
||||
public bool IsDirty
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DataContext != null)
|
||||
{
|
||||
if (DataContext is IBaseViewModel baseViewModel)
|
||||
{
|
||||
return baseViewModel.IsDirty;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a header info which uses by the TabControl to display the TabItem's header.
|
||||
/// </summary>
|
||||
public string HeaderInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DataContext != null)
|
||||
{
|
||||
if (DataContext is IHeaderInfoProvider<string> headerInfoProvider)
|
||||
{
|
||||
return headerInfoProvider.HeaderInfo;
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class EnumVisibilityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null != value && value.Equals(parameter) ? Visibility.Visible : Visibility.Hidden;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return null != value && value.Equals(Visibility.Visible) ? parameter : Binding.DoNothing;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class BooleanOrToVisibilityMultiConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
var useFalseAsVisible = parameter != null && parameter.ToString().ToUpper().Contains("FALSE");
|
||||
var hideNotCollapse = parameter != null && parameter.ToString().ToUpper().Contains("HIDE");
|
||||
|
||||
bool value = !values.All(val => val is bool) ? false : values.Any(val => (bool)val);
|
||||
if (useFalseAsVisible)
|
||||
{
|
||||
if (!value)
|
||||
return Visibility.Visible;
|
||||
return hideNotCollapse ? Visibility.Hidden : Visibility.Collapsed;
|
||||
}
|
||||
if (!value)
|
||||
return hideNotCollapse ? Visibility.Hidden : Visibility.Collapsed;
|
||||
return Visibility.Visible;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using DTS.Common.RibbonControl;
|
||||
|
||||
namespace DTS.Common.Interface
|
||||
{
|
||||
public interface ILabDetailsMenuViewModel : IRibbonViewModel { }
|
||||
}
|
||||
Reference in New Issue
Block a user