|
@@ -343,7 +343,8 @@ namespace PDF_Office.Views.PageEdit
|
|
|
}
|
|
|
var scroll = GetScrollHost(ListPageEdit);
|
|
|
|
|
|
- string tempPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Temp.pdf");
|
|
|
+ string filename = Guid.NewGuid().ToString() + ".pdf";
|
|
|
+ string tempPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), filename);
|
|
|
System.IO.File.Create(tempPath);
|
|
|
string[] files = new string[1];
|
|
|
files[0] = tempPath;
|
|
@@ -398,12 +399,43 @@ namespace PDF_Office.Views.PageEdit
|
|
|
}
|
|
|
//选中了item 时,不能框选
|
|
|
startChoose = false;
|
|
|
+
|
|
|
+ //更改系统的选中规则,选中状态下,鼠标松开后取消选中
|
|
|
+ //方便实现多选拖拽功能
|
|
|
+ if (listBoxItem.IsSelected == true && !Keyboard.IsKeyDown(Key.LeftCtrl))
|
|
|
+ {
|
|
|
+ e.Handled = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void ListPageEdit_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
- startChoose = false;
|
|
|
+ var pos = e.GetPosition(ListPageEdit);
|
|
|
+ HitTestResult result = VisualTreeHelper.HitTest(ListPageEdit, pos);
|
|
|
+ if (result == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
|
|
|
+ if (listBoxItem == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //更改系统默认的选中规则,多选后,鼠标单击抬起后再选中单个
|
|
|
+ //拖拽框选之后的抬起鼠标不进入处理
|
|
|
+ if (!startChoose&&!Keyboard.IsKeyDown(Key.LeftCtrl) && !Keyboard.IsKeyDown(Key.LeftShift))
|
|
|
+ {
|
|
|
+ ListPageEdit.SelectedItems.Clear();
|
|
|
+ ListPageEdit.SelectedItem = listBoxItem;
|
|
|
+ listBoxItem.IsSelected = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
Mouse.Capture(null);
|
|
|
+ //结束鼠标框选
|
|
|
+ startChoose = false;
|
|
|
RectChoose.Visibility = Visibility.Collapsed;
|
|
|
}
|
|
|
|
|
@@ -420,7 +452,7 @@ namespace PDF_Office.Views.PageEdit
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- ///根据鼠标拖选的框 选中里面的Item
|
|
|
+ ///根据鼠标拖选的框 选中矩形框里面的Item
|
|
|
/// </summary>
|
|
|
private void DoSelectItems()
|
|
|
{
|