aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-18 18:48:16 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-18 18:48:16 +0200
commit95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff (patch)
treede29ed87bd7c7b966d35b6f6bc8b13d65313c88c /Software/Visual_Studio/Tango.SharedUI
parent99136fc92c8b75c3783f543051c065c28961d393 (diff)
downloadTango-95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff.tar.gz
Tango-95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff.zip
Working on new developer module.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs37
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs38
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj2
3 files changed, 77 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs
new file mode 100644
index 000000000..0f3032e01
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectDataGrid.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Tango.SharedUI.Controls
+{
+ public class MultiSelectDataGrid : DataGrid
+ {
+ public IList SelectedItemsList
+ {
+ get { return (IList)GetValue(SelectedItemsListProperty); }
+ set { SetValue(SelectedItemsListProperty, value); }
+ }
+
+ public static readonly DependencyProperty SelectedItemsListProperty =
+ DependencyProperty.Register(nameof(SelectedItemsList), typeof(IList), typeof(MultiSelectDataGrid), new PropertyMetadata(null));
+
+ public MultiSelectDataGrid() { }
+
+ protected override void OnSelectionChanged(SelectionChangedEventArgs e)
+ {
+ base.OnSelectionChanged(e);
+
+ SelectedItemsList.Clear();
+
+ foreach (var item in SelectedItems)
+ {
+ SelectedItemsList.Add(item);
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs
new file mode 100644
index 000000000..ca45540fa
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/MultiSelectListBox.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Tango.SharedUI.Controls
+{
+ public class MultiSelectListBox : ListBox
+ {
+ public IList SelectedItemsList
+ {
+ get { return (IList)GetValue(SelectedItemsListProperty); }
+ set { SetValue(SelectedItemsListProperty, value); }
+ }
+
+ public static readonly DependencyProperty SelectedItemsListProperty =
+ DependencyProperty.Register(nameof(SelectedItemsList), typeof(IList), typeof(MultiSelectListBox), new PropertyMetadata(null));
+
+ public MultiSelectListBox() { }
+
+ protected override void OnSelectionChanged(SelectionChangedEventArgs e)
+ {
+ base.OnSelectionChanged(e);
+
+ SelectedItemsList.Clear();
+
+ foreach (var item in SelectedItems)
+ {
+ SelectedItemsList.Add(item);
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
index 0993f61fd..e7f53ad7a 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
+++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
@@ -78,6 +78,8 @@
<Compile Include="Controls\HiveControl.xaml.cs">
<DependentUpon>HiveControl.xaml</DependentUpon>
</Compile>
+ <Compile Include="Controls\MultiSelectDataGrid.cs" />
+ <Compile Include="Controls\MultiSelectListBox.cs" />
<Compile Include="Controls\MultiTransitionControl.xaml.cs">
<DependentUpon>MultiTransitionControl.xaml</DependentUpon>
</Compile>