开发者

Drag and drop with wpf and nested listview

开发者 https://www.devze.com 2022-12-26 21:45 出处:网络
I have a model like this: <List> <Obj Number=\"1\"> <Group Number=\"1\"> <Detail Name=\"AAA\"/>

I have a model like this:

<List>
<Obj Number="1">
    <Group Number="1">
        <Detail Name="AAA"/>
    </Group >
</Obj >
<Obj  Number="2">
    <Group Number="1">
        <Detail Name="BBB"/>
    </Group >
</Obj >
<Obj Number="3">
    <Group Number="1">
        <Detail Name="CCC"/>
    </Group >
    <Group Number="2">
        <Detail开发者_如何转开发 Name="DDD"/>
    </Group >
</Obj >
</Lista> 

I want to be able to drag a Detail into another Group or into white space (in order to create parent elements Obj and Group)

I have created DataTemplate for each entity with a ListView inside Obj and Group entities template. But every example I have found on web can't drag correctly the element because mouse events are raised from the parent ListView and not from the ListView that contains Details entities.

0

精彩评论

暂无评论...
验证码 换一张
取 消