From af685d6d0f9162f3fb7b05bf3d47de10c0685a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=AB=E5=9F=8Evia?= Date: Mon, 8 Jul 2024 17:46:32 +0800 Subject: [PATCH] 1.2.2.1 (#223) * 1.2.2.1 --- .../Panuon.WPF.UI.Internal.projitems | 1 + .../Templates/ExpanderTemplate.xaml | 2 +- .../Templates/NumberInputTemplate.xaml | 12 +- .../Panuon.WPF.UI/Controls/MultiComboBox.cs | 45 ++++++ .../Panuon.WPF.UI/Controls/NumberInput.cs | 37 ++--- .../Controls/ToggleButtonGroup.cs | 96 +++++++++++- .../Panuon.WPF.UI/Helpers/ComboBoxHelper.cs | 20 +-- .../Panuon.WPF.UI/Helpers/DataGridHelper.cs | 14 +- .../Panuon.WPF.UI/Helpers/ListBoxHelper.cs | 48 ++++++ .../Helpers/ToggleButtonHelper.cs | 137 +++++++++++++++++- .../Panuon.WPF.UI/Properties/AssemblyInfo.cs | 5 +- .../Panuon.WPF.UI.Internal/Models/EnumInfo.cs | 18 +++ 12 files changed, 383 insertions(+), 52 deletions(-) create mode 100644 SourceCode/sharedResources/Panuon.WPF.UI.Internal/Models/EnumInfo.cs diff --git a/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Panuon.WPF.UI.Internal.projitems b/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Panuon.WPF.UI.Internal.projitems index 339dd096..ef0c8e7c 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Panuon.WPF.UI.Internal.projitems +++ b/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Panuon.WPF.UI.Internal.projitems @@ -82,6 +82,7 @@ + diff --git a/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Templates/ExpanderTemplate.xaml b/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Templates/ExpanderTemplate.xaml index cc83683c..d4c6e23c 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Templates/ExpanderTemplate.xaml +++ b/SourceCode/SharedResources/Panuon.WPF.UI.Internal/Templates/ExpanderTemplate.xaml @@ -80,7 +80,7 @@ - - - @@ -221,7 +221,7 @@ - @@ -240,7 +240,7 @@ - - @@ -286,7 +286,7 @@ - diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/MultiComboBox.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/MultiComboBox.cs index d82c3d6c..1d3c5166 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/MultiComboBox.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/MultiComboBox.cs @@ -1,4 +1,5 @@ using Panuon.WPF.UI.Internal; +using Panuon.WPF.UI.Internal.Models; using Panuon.WPF.UI.Internal.Utils; using System; using System.Collections; @@ -78,6 +79,17 @@ public event RoutedEventHandler ItemRemoved #region Properties + #region BindToEnum + public Enum BindToEnum + { + get { return (Enum)GetValue(BindToEnumProperty); } + set { SetValue(BindToEnumProperty, value); } + } + + public static readonly DependencyProperty BindToEnumProperty = + DependencyProperty.Register("BindToEnum", typeof(Enum), typeof(MultiComboBox), new PropertyMetadata(OnBindToEnumChanged)); + #endregion + #region ClearCommand public ICommand ClearCommand { @@ -837,6 +849,39 @@ private void DropDown_Closed(object sender, EventArgs e) } #endregion + #region Event Handlers + private static void OnBindToEnumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var comboBox = d as MultiComboBox; + + var type = e.NewValue?.GetType(); + + if (type != null) + { + var enumList = new List(); + foreach (Enum item in Enum.GetValues(type)) + { + var field = type.GetField(item.ToString()); + if (null != field) + { + var descriptions = field.GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[]; + if (descriptions.Length > 0) + { + enumList.Add(new EnumInfo(descriptions[0].Description, item)); + } + else + { + enumList.Add(new EnumInfo(item.ToString(), item)); + } + } + } + comboBox.DisplayMemberPath = nameof(EnumInfo.DisplayName); + comboBox.SelectedValuePath = nameof(EnumInfo.Value); + comboBox.ItemsSource = enumList; + } + } + #endregion + #region Functions private static void OnRemoveCommandExecute(object obj) { diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/NumberInput.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/NumberInput.cs index 1db90dad..95da1bce 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/NumberInput.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/NumberInput.cs @@ -582,29 +582,30 @@ private void UpdateTextFromValue() { return; } - if (_isInternalSet) - { - return; - } - - _isInternalSet = true; - _inputTextBox.Text = Value == null - ? null - : FormatValueText(); - - _isInternalSet = false; + try + { + _isInternalSet = true; + var carentIndex = _inputTextBox.CaretIndex; + _inputTextBox.Text = Value == null + ? null + : FormatValueText(); + if (carentIndex != -1) + { + _inputTextBox.Select(carentIndex, 0); + } + } + finally + { + _isInternalSet = false; + } } private void UpdateValueFromText() { - if (_inputTextBox == null) - { - return; - } - - if (_isInternalSet) + if (_isInternalSet + || _inputTextBox == null) { return; } @@ -627,7 +628,7 @@ private void UpdateValueFromText() else if (double.TryParse(_inputTextBox.Text, out double doubleValue)) { SetCurrentValue(ValueProperty, doubleValue); - if(Value != doubleValue) + if (Value != doubleValue) { UpdateTextFromValue(); } diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/ToggleButtonGroup.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/ToggleButtonGroup.cs index 254b3557..a8dcbbfa 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Controls/ToggleButtonGroup.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Controls/ToggleButtonGroup.cs @@ -1,4 +1,11 @@ -using System.Windows; +using Panuon.WPF.UI.Internal.Models; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Windows; +using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; @@ -7,10 +14,17 @@ namespace Panuon.WPF.UI public class ToggleButtonGroup : MultiSelector { + #region Fields + private string _groupId = Guid.NewGuid().ToString(); + #endregion + #region Ctor static ToggleButtonGroup() { - DefaultStyleKeyProperty.OverrideMetadata(typeof(ToggleButtonGroup), new FrameworkPropertyMetadata(typeof(ToggleButtonGroup))); + DefaultStyleKeyProperty.OverrideMetadata( + typeof(ToggleButtonGroup), + new FrameworkPropertyMetadata(typeof(ToggleButtonGroup)) + ); } public ToggleButtonGroup() @@ -23,12 +37,19 @@ public ToggleButtonGroup() #region Overrides protected override bool IsItemItsOwnContainerOverride(object item) { - return item is ToggleButton; + if (item is ToggleButton toggleButton) + { + ToggleButtonHelper.SetGroupName(toggleButton, AllowMultipleSelection ? null : _groupId); + return true; + } + return false; } protected override DependencyObject GetContainerForItemOverride() { - return new ToggleButton(); + var toggleButton = new ToggleButton(); + ToggleButtonHelper.SetGroupName(toggleButton, AllowMultipleSelection ? null : _groupId); + return toggleButton; } #endregion @@ -39,6 +60,28 @@ protected override DependencyObject GetContainerForItemOverride() #region Properties + #region AllowMultipleSelection + public bool AllowMultipleSelection + { + get { return (bool)GetValue(AllowMultipleSelectionProperty); } + set { SetValue(AllowMultipleSelectionProperty, value); } + } + + public static readonly DependencyProperty AllowMultipleSelectionProperty = + DependencyProperty.Register("AllowMultipleSelection", typeof(bool), typeof(ToggleButtonGroup), new PropertyMetadata(true, OnAllowMultipleSelectionChanged)); + #endregion + + #region BindToEnum + public Enum BindToEnum + { + get { return (Enum)GetValue(BindToEnumProperty); } + set { SetValue(BindToEnumProperty, value); } + } + + public static readonly DependencyProperty BindToEnumProperty = + DependencyProperty.Register("BindToEnum", typeof(Enum), typeof(ToggleButtonGroup), new PropertyMetadata(OnBindToEnumChanged)); + #endregion + #region ItemsWidth public double ItemsWidth { @@ -306,7 +349,42 @@ public VerticalAlignment ItemsVerticalContentAlignment #endregion #region Event Handlers + private static void OnBindToEnumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var toggleButtonGroup = d as ToggleButtonGroup; + + var type = e.NewValue?.GetType(); + if (type != null) + { + var enumList = new List(); + foreach (Enum item in Enum.GetValues(type)) + { + var field = type.GetField(item.ToString()); + if (null != field) + { + var descriptions = field.GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[]; + if (descriptions.Length > 0) + { + enumList.Add(new EnumInfo(descriptions[0].Description, item)); + } + else + { + enumList.Add(new EnumInfo(item.ToString(), item)); + } + } + } + toggleButtonGroup.DisplayMemberPath = nameof(EnumInfo.DisplayName); + toggleButtonGroup.SelectedValuePath = nameof(EnumInfo.Value); + toggleButtonGroup.ItemsSource = enumList; + } + } + + private static void OnAllowMultipleSelectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var toggleButtonGroup = d as ToggleButtonGroup; + toggleButtonGroup.OnAllowMultipleSelectionChanged(); + } private void OnToggleButtonCheckChanged(object sender, RoutedEventArgs e) { @@ -325,5 +403,15 @@ private void OnToggleButtonCheckChanged(object sender, RoutedEventArgs e) } } #endregion + + #region Functions + private void OnAllowMultipleSelectionChanged() + { + foreach (ToggleButton toggleButton in ItemContainerGenerator.Items) + { + ToggleButtonHelper.SetGroupName(toggleButton, AllowMultipleSelection ? null : _groupId); + } + } + #endregion } } diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ComboBoxHelper.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ComboBoxHelper.cs index 906d40d2..9aeff5f1 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ComboBoxHelper.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ComboBoxHelper.cs @@ -1,4 +1,5 @@ using Panuon.WPF.UI.Internal; +using Panuon.WPF.UI.Internal.Models; using Panuon.WPF.UI.Internal.Utils; using System; using System.Collections; @@ -1233,24 +1234,17 @@ private static void OnBindToEnumChanged(DependencyObject d, DependencyPropertyCh var descriptions = field.GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[]; if (descriptions.Length > 0) { - enumList.Add(new - { - Name = descriptions[0].Description, - Enum = item, - }); + enumList.Add(new EnumInfo(descriptions[0].Description, item)); } else - enumList.Add(new - { - Name = item.ToString(), - Enum = item, - }); + { + enumList.Add(new EnumInfo(item.ToString(), item)); + } } } + comboBox.DisplayMemberPath = nameof(EnumInfo.DisplayName); + comboBox.SelectedValuePath = nameof(EnumInfo.Value); comboBox.ItemsSource = enumList; - comboBox.DisplayMemberPath = "Name"; - comboBox.SelectedValuePath = "Enum"; - comboBox.SetCurrentValue(ComboBox.SelectedValueProperty, comboBox.SelectedValue ?? e.NewValue); } } diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/DataGridHelper.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/DataGridHelper.cs index 91076223..97837a5d 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/DataGridHelper.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/DataGridHelper.cs @@ -1230,18 +1230,18 @@ public static void SetRowHeaderHoverBorderBrush(DataGrid dataGrid, Brush value) #endregion #region RowHeaderHoverBorderThickness - public static Thickness GetRowHeaderHoverBorderThickness(DataGrid dataGrid) + public static Thickness? GetRowHeaderHoverBorderThickness(DataGrid dataGrid) { return (Thickness)dataGrid.GetValue(RowHeaderHoverBorderThicknessProperty); } - public static void SetRowHeaderHoverBorderThickness(DataGrid dataGrid, Thickness value) + public static void SetRowHeaderHoverBorderThickness(DataGrid dataGrid, Thickness? value) { dataGrid.SetValue(RowHeaderHoverBorderThicknessProperty, value); } public static readonly DependencyProperty RowHeaderHoverBorderThicknessProperty = - DependencyProperty.RegisterAttached("RowHeaderHoverBorderThickness", typeof(Thickness), typeof(DataGridHelper)); + DependencyProperty.RegisterAttached("RowHeaderHoverBorderThickness", typeof(Thickness?), typeof(DataGridHelper)); #endregion #region RowHeaderClickForeground @@ -1290,18 +1290,18 @@ public static void SetRowHeaderClickBorderBrush(DataGrid dataGrid, Brush value) #endregion #region RowHeaderClickBorderThickness - public static Thickness GetRowHeaderClickBorderThickness(DataGrid dataGrid) + public static Thickness? GetRowHeaderClickBorderThickness(DataGrid dataGrid) { - return (Thickness)dataGrid.GetValue(RowHeaderClickBorderThicknessProperty); + return (Thickness?)dataGrid.GetValue(RowHeaderClickBorderThicknessProperty); } - public static void SetRowHeaderClickBorderThickness(DataGrid dataGrid, Thickness value) + public static void SetRowHeaderClickBorderThickness(DataGrid dataGrid, Thickness? value) { dataGrid.SetValue(RowHeaderClickBorderThicknessProperty, value); } public static readonly DependencyProperty RowHeaderClickBorderThicknessProperty = - DependencyProperty.RegisterAttached("RowHeaderClickBorderThickness", typeof(Thickness), typeof(DataGridHelper)); + DependencyProperty.RegisterAttached("RowHeaderClickBorderThickness", typeof(Thickness?), typeof(DataGridHelper)); #endregion #endregion diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ListBoxHelper.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ListBoxHelper.cs index 81475406..4b1ec00d 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ListBoxHelper.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ListBoxHelper.cs @@ -1,4 +1,5 @@ using Panuon.WPF.UI.Internal; +using Panuon.WPF.UI.Internal.Models; using Panuon.WPF.UI.Internal.Utils; using System; using System.Collections; @@ -203,6 +204,21 @@ public static void SetSelectedItems(ListBox listBox, IList value) DependencyProperty.RegisterAttached("SelectedItems", typeof(IList), typeof(ListBoxHelper)); #endregion + #region BindToEnum + public static Enum GetBindToEnum(ListBox listBox) + { + return (Enum)listBox.GetValue(BindToEnumProperty); + } + + public static void SetBindToEnum(ListBox listBox, Enum value) + { + listBox.SetValue(BindToEnumProperty, value); + } + + public static readonly DependencyProperty BindToEnumProperty = + DependencyProperty.RegisterAttached("BindToEnum", typeof(Enum), typeof(ListBoxHelper), new PropertyMetadata(OnBindToEnumChanged)); + #endregion + #region Items Properties #region ItemsIcon @@ -818,6 +834,38 @@ private static void OnAutoScrollIntoViewChanged(DependencyObject d, DependencyPr } } + private static void OnBindToEnumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var listBox = d as ListBox; + + var type = e.NewValue?.GetType(); + + if (type != null) + { + var enumList = new ArrayList(); + foreach (Enum item in Enum.GetValues(type)) + { + var field = type.GetField(item.ToString()); + if (null != field) + { + var descriptions = field.GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[]; + if (descriptions.Length > 0) + { + enumList.Add(new EnumInfo(descriptions[0].Description, item)); + } + else + { + enumList.Add(new EnumInfo(item.ToString(), item)); + } + } + } + listBox.DisplayMemberPath = nameof(EnumInfo.DisplayName); + listBox.SelectedValuePath = nameof(EnumInfo.Value); + listBox.ItemsSource = enumList; + } + } + + private static void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var listBox = (ListBox)sender; diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ToggleButtonHelper.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ToggleButtonHelper.cs index 0ec30a18..ee5001cb 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ToggleButtonHelper.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/ToggleButtonHelper.cs @@ -1,6 +1,8 @@ using Panuon.WPF.UI.Internal; +using System; +using System.Collections.Generic; +using System.Linq; using System.Windows; -using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; @@ -8,6 +10,13 @@ namespace Panuon.WPF.UI { public static class ToggleButtonHelper { + #region Fields + private static readonly Dictionary>> _groupedToggleButtons = + new Dictionary>>(); + + private static bool _isInternalSet = false; + #endregion + #region ComponentResourceKeys public static ComponentResourceKey PendingSpinStyleKey { get; } = new ComponentResourceKey(typeof(ToggleButtonHelper), nameof(PendingSpinStyleKey)); @@ -388,7 +397,133 @@ public static void SetCheckedCornerRadius(ToggleButton toggleButton, CornerRadiu DependencyProperty.RegisterAttached("CheckedCornerRadius", typeof(CornerRadius?), typeof(ToggleButtonHelper)); #endregion + #region GroupName + public static string GetGroupName(ToggleButton toggleButton) + { + return (string)toggleButton.GetValue(GroupNameProperty); + } + + public static void SetGroupName(ToggleButton toggleButton, string value) + { + toggleButton.SetValue(GroupNameProperty, value); + } + + public static readonly DependencyProperty GroupNameProperty = + DependencyProperty.RegisterAttached("GroupName", typeof(string), typeof(ToggleButtonHelper), new PropertyMetadata(OnGroupNameChanged)); + + #endregion + + #endregion + #region Event Handlers + private static void OnGroupNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var toggleButton = d as ToggleButton; + + toggleButton.Checked -= ToggleButton_CheckChanged; + toggleButton.Unchecked -= ToggleButton_CheckChanged; + toggleButton.Indeterminate -= ToggleButton_CheckChanged; + toggleButton.PreviewMouseLeftButtonDown -= ToggleButton_PreviewMouseLeftButtonDown; + + var oldGroupName = (string)e.OldValue; + var groupName = (string)e.NewValue; + if (!string.IsNullOrEmpty(oldGroupName)) + { + if (_groupedToggleButtons.ContainsKey(oldGroupName)) + { + var list = _groupedToggleButtons[oldGroupName]; + for (int i = list.Count - 1; i >= 0; i--) + { + if (!list[i].TryGetTarget(out var target) + || target == toggleButton) + { + list.RemoveAt(i); + } + } + } + } + if (!string.IsNullOrEmpty(groupName)) + { + toggleButton.Checked += ToggleButton_CheckChanged; + toggleButton.Unchecked += ToggleButton_CheckChanged; + toggleButton.Indeterminate += ToggleButton_CheckChanged; + toggleButton.PreviewMouseLeftButtonDown += ToggleButton_PreviewMouseLeftButtonDown; + + if (!_groupedToggleButtons.ContainsKey(groupName)) + { + _groupedToggleButtons.Add(groupName, new List>()); + } + _groupedToggleButtons[groupName].Add(new WeakReference(toggleButton)); + } + } + + private static void ToggleButton_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + var toggleButton = sender as ToggleButton; + var groupName = GetGroupName(toggleButton); + var isChecked = toggleButton.IsChecked == true; + if (isChecked) + { + e.Handled = true; + } + } + + private static void ToggleButton_CheckChanged(object sender, RoutedEventArgs e) + { + if (_isInternalSet) + { + return; + } + var toggleButton = sender as ToggleButton; + var groupName = GetGroupName(toggleButton); + var isChecked = toggleButton.IsChecked == true; + if (string.IsNullOrEmpty(groupName)) + { + return; + } + + try + { + _isInternalSet = true; + var toggleButtons = new List(); + if (_groupedToggleButtons.ContainsKey(groupName)) + { + var list = _groupedToggleButtons[groupName]; + for (int i = list.Count - 1; i >= 0; i--) + { + if (list[i].TryGetTarget(out var target)) + { + toggleButtons.Add(target); + } + else + { + list.RemoveAt(i); + } + } + if (isChecked) + { + foreach (var target in toggleButtons) + { + if (target != toggleButton) + { + target.IsChecked = false; + } + } + } + else + { + if (toggleButtons.All(t => t.IsChecked != true)) + { + toggleButton.IsChecked = true; + } + } + } + } + finally + { + _isInternalSet = false; + } + } #endregion } } \ No newline at end of file diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Properties/AssemblyInfo.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Properties/AssemblyInfo.cs index d9ca49c6..5140b40f 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Properties/AssemblyInfo.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Properties/AssemblyInfo.cs @@ -19,11 +19,12 @@ [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("Panuon.WPF.UI.Themes")] +[assembly: InternalsVisibleTo("Samples")] [assembly: ThemeInfo( ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly )] -[assembly: AssemblyVersion("1.2.1.10")] -[assembly: AssemblyFileVersion("1.2.1.10")] \ No newline at end of file +[assembly: AssemblyVersion("1.2.2.1")] +[assembly: AssemblyFileVersion("1.2.2.1")] \ No newline at end of file diff --git a/SourceCode/sharedResources/Panuon.WPF.UI.Internal/Models/EnumInfo.cs b/SourceCode/sharedResources/Panuon.WPF.UI.Internal/Models/EnumInfo.cs new file mode 100644 index 00000000..7c644985 --- /dev/null +++ b/SourceCode/sharedResources/Panuon.WPF.UI.Internal/Models/EnumInfo.cs @@ -0,0 +1,18 @@ +using System; + +namespace Panuon.WPF.UI.Internal.Models +{ + class EnumInfo + { + public EnumInfo(string displayName, + Enum value) + { + DisplayName = displayName; + Value = value; + } + + public string DisplayName { get; } + + public Enum Value { get; } + } +}