mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-16 10:58:31 -05:00
Keep selection when going to drag feeds
This commit is contained in:
@@ -28,7 +28,8 @@
|
|||||||
CanUserResizeRows="False"
|
CanUserResizeRows="False"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
HeadersVisibility="Column"
|
HeadersVisibility="Column"
|
||||||
Background="{x:Null}">
|
Background="{x:Null}"
|
||||||
|
PreviewMouseLeftButtonDown="HandleFeedListPreviewMouseLeftButtonDown">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Binding="{Binding Name}"
|
<DataGridTextColumn Binding="{Binding Name}"
|
||||||
Header="{x:Static properties:Resources.FeedNameColumnHeader}"
|
Header="{x:Static properties:Resources.FeedNameColumnHeader}"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
namespace FeedCenter.Options
|
namespace FeedCenter.Options
|
||||||
@@ -433,5 +434,18 @@ namespace FeedCenter.Options
|
|||||||
var bulkFeedWindow = new BulkFeedWindow();
|
var bulkFeedWindow = new BulkFeedWindow();
|
||||||
bulkFeedWindow.Display(Window.GetWindow(this), Database);
|
bulkFeedWindow.Display(Window.GetWindow(this), Database);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleFeedListPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
// Get the object that was clicked on
|
||||||
|
var originalSource = (DependencyObject) e.OriginalSource;
|
||||||
|
|
||||||
|
// Look for a row that contains the object
|
||||||
|
var dataGridRow = (DataGridRow) FeedListBox.ContainerFromElement(originalSource);
|
||||||
|
|
||||||
|
// If the selection already contains this row then ignore it
|
||||||
|
if (dataGridRow != null && FeedListBox.SelectedItems.Contains(dataGridRow.Item))
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user