aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-24 18:31:31 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-24 18:31:31 +0200
commit912e8423fbf63a025dac977d5749e60d4c57df68 (patch)
treef7bf2901f49cc2d970a8e5c2fb79069b03798ae2 /Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
parent74090438f4bbd60ad561c35b63b351a54014e4d2 (diff)
downloadTango-912e8423fbf63a025dac977d5749e60d4c57df68.tar.gz
Tango-912e8423fbf63a025dac977d5749e60d4c57df68.zip
Working on storage.
Diffstat (limited to 'Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs')
-rw-r--r--Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs51
1 files changed, 33 insertions, 18 deletions
diff --git a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
index 60061780b..c624178a0 100644
--- a/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
+++ b/Software/Visual_Studio/Tango.FileSystem/FileExplorerControl.cs
@@ -265,6 +265,15 @@ namespace Tango.FileSystem
public static readonly DependencyProperty AllowDragProperty =
DependencyProperty.Register("AllowDrag", typeof(bool), typeof(FileExplorerControl), new PropertyMetadata(null));
+ public SelectionMode SelectionMode
+ {
+ get { return (SelectionMode)GetValue(SelectionModeProperty); }
+ set { SetValue(SelectionModeProperty, value); }
+ }
+ public static readonly DependencyProperty SelectionModeProperty =
+ DependencyProperty.Register("SelectionMode", typeof(SelectionMode), typeof(FileExplorerControl), new PropertyMetadata(SelectionMode.Extended));
+
+
static FileExplorerControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(FileExplorerControl), new FrameworkPropertyMetadata(typeof(FileExplorerControl)));
@@ -492,39 +501,45 @@ namespace Tango.FileSystem
private void _datagrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- if (!_preventSynchronization)
+ if (SelectionMode == SelectionMode.Extended)
{
- _preventSynchronization = true;
+ if (!_preventSynchronization)
+ {
+ _preventSynchronization = true;
- _listBox.SelectedItems.Clear();
+ _listBox.SelectedItems.Clear();
- foreach (var item in _datagrid.SelectedItems)
- {
- _listBox.SelectedItems.Add(item);
- }
+ foreach (var item in _datagrid.SelectedItems)
+ {
+ _listBox.SelectedItems.Add(item);
+ }
- SynchronizeSelectedItems(_listBox.SelectedItems);
+ SynchronizeSelectedItems(_listBox.SelectedItems);
- _preventSynchronization = false;
+ _preventSynchronization = false;
+ }
}
}
private void _listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- if (!_preventSynchronization)
+ if (SelectionMode == SelectionMode.Extended)
{
- _preventSynchronization = true;
+ if (!_preventSynchronization)
+ {
+ _preventSynchronization = true;
- _datagrid.SelectedItems.Clear();
+ _datagrid.SelectedItems.Clear();
- foreach (var item in _listBox.SelectedItems)
- {
- _datagrid.SelectedItems.Add(item);
- }
+ foreach (var item in _listBox.SelectedItems)
+ {
+ _datagrid.SelectedItems.Add(item);
+ }
- SynchronizeSelectedItems(_listBox.SelectedItems);
+ SynchronizeSelectedItems(_listBox.SelectedItems);
- _preventSynchronization = false;
+ _preventSynchronization = false;
+ }
}
}