fix(Launcher): using MouseMove instead of PreviewMouseMove event

This commit is contained in:
leo 2020-08-03 18:34:53 +08:00
parent a4d1617c5a
commit 4bb20616db
2 changed files with 3 additions and 2 deletions

View file

@ -114,7 +114,7 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
<EventSetter Event="PreviewMouseMove" Handler="TabsPreviewMouseMove"/> <EventSetter Event="MouseMove" Handler="TabsMouseMove"/>
<EventSetter Event="Drop" Handler="TabsDrop"/> <EventSetter Event="Drop" Handler="TabsDrop"/>
</Style> </Style>
</TabControl.ItemContainerStyle> </TabControl.ItemContainerStyle>

View file

@ -180,12 +180,13 @@ namespace SourceGit.UI {
#endregion #endregion
#region DRAG_DROP #region DRAG_DROP
private void TabsPreviewMouseMove(object sender, MouseEventArgs e) { private void TabsMouseMove(object sender, MouseEventArgs e) {
var tab = e.Source as TabItem; var tab = e.Source as TabItem;
if (tab == null || (tab.DataContext as Tab).Repo == null) return; if (tab == null || (tab.DataContext as Tab).Repo == null) return;
if (Mouse.LeftButton == MouseButtonState.Pressed) { if (Mouse.LeftButton == MouseButtonState.Pressed) {
DragDrop.DoDragDrop(tab, tab, DragDropEffects.All); DragDrop.DoDragDrop(tab, tab, DragDropEffects.All);
e.Handled = true;
} }
} }