|
@@ -45,16 +45,16 @@ namespace Waaagh.Behaviors {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static Func<object, Type, IList?> GetTryGetSubCollection(DependencyObject obj) {
|
|
|
|
- return (Func<object, Type, IList?>)obj.GetValue(TryGetSubCollectionProperty);
|
|
|
|
|
|
+ public static Func<object, Type, IList?> GetQueryTargetCollection(DependencyObject obj) {
|
|
|
|
+ return (Func<object, Type, IList?>)obj.GetValue(QueryTargetCollectionProperty);
|
|
}
|
|
}
|
|
|
|
|
|
- public static void SetTryGetSubCollection(DependencyObject obj, Func<object, Type, IList?> value) {
|
|
|
|
- obj.SetValue(TryGetSubCollectionProperty, value);
|
|
|
|
|
|
+ public static void SetQueryTargetCollection(DependencyObject obj, Func<object, Type, IList?> value) {
|
|
|
|
+ obj.SetValue(QueryTargetCollectionProperty, value);
|
|
}
|
|
}
|
|
|
|
|
|
- public static readonly DependencyProperty TryGetSubCollectionProperty =
|
|
|
|
- DependencyProperty.RegisterAttached("TryGetSubCollection", typeof(Func<object, Type, IList?>), typeof(ItemsDraggable), new PropertyMetadata(null));
|
|
|
|
|
|
+ public static readonly DependencyProperty QueryTargetCollectionProperty =
|
|
|
|
+ DependencyProperty.RegisterAttached("QueryTargetCollection", typeof(Func<object, Type, IList?>), typeof(ItemsDraggable), new PropertyMetadata(null));
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
@@ -114,7 +114,7 @@ namespace Waaagh.Behaviors {
|
|
// 判断 集合元素类型
|
|
// 判断 集合元素类型
|
|
object? targetData = targetControl.DataContext;
|
|
object? targetData = targetControl.DataContext;
|
|
if (CheckCollectionElementType(sourceCollection, targetCollection) == false) {
|
|
if (CheckCollectionElementType(sourceCollection, targetCollection) == false) {
|
|
- IList? collection = GetTryGetSubCollection(targetItemsControl)?.Invoke(targetControl.DataContext, sourceData.GetType());
|
|
|
|
|
|
+ IList? collection = GetQueryTargetCollection(targetItemsControl)?.Invoke(targetControl.DataContext, sourceData.GetType());
|
|
if (collection == null || CheckCollectionElementType(sourceCollection, collection) == false) {
|
|
if (collection == null || CheckCollectionElementType(sourceCollection, collection) == false) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -191,7 +191,6 @@ namespace Waaagh.Behaviors {
|
|
position.Y < 0 || position.Y > control.ActualHeight) {
|
|
position.Y < 0 || position.Y > control.ActualHeight) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- // 鼠标在控件内
|
|
|
|
if (control is ContentControl) {
|
|
if (control is ContentControl) {
|
|
child = control;
|
|
child = control;
|
|
return true;
|
|
return true;
|