s:SurfaceDragDrop
이벤트와
SurfaceListBox
에 객체 (
ScatterViewItem
를) 포기하고있어
에 떨어졌다 때 SurfaceListBoxItem 및 ScatterViewItem 가져 오기를 전체 SurfaceListBox
에 낙하를 감지 할 때 그것을 잘 작동합니다 SurfaceListBoxItem
개체가 삭제 된 것을 알고 싶습니다.나는, 그러나, 객체가 SurfaceListBox 및 ScatterView
또한 ScatterView
에 대해이 작업을 수행하려고합니다. 즉 ScatterView
중 어느 객체가 누락되었는지 감지하는 중입니다.
내 코드는 다음과 같은 것입니다 :
<s:SurfaceListBox
x:Name="listBoxList"
Background="{x:Null}"
AllowDrop="True"
s:SurfaceDragDrop.Drop="ListBox_Drop" >
</s:SurfaceListBox>
<s:ScatterView
x:Name="scatterList"
Background="{x:Null}"
AllowDrop="True"
s:SurfaceDragDrop.Drop="Scatter_Drop" >
</s:ScatterView>
그리고 내 항목을 추가 :
listBoxList.Items.Add("ListBox Item 1");
listBoxList.Items.Add("ListBox Item 1");
listBoxList.Items.Add("ListBox Item 1");
scatterList.Items.Add("ScatterViewItem A");
scatterList.Items.Add("ScatterViewItem B");
scatterList.Items.Add("ScatterViewItem C");
그래서 내가 어떻게
ListBox_Drop
및
Scatter_Drop
에 항목을 얻을 수 있나요?
편집
로버트 응답을 통해 나는 내 문제를 해결하기 위해 관리. 그래서 결과 코드합니다 (ScatterView
에 대한)이 같은 것입니다 :
<s:ScatterView
x:Name="scatterList"
Background="{x:Null}">
<s:ScatterView.ItemContainerStyle>
<Style TargetType="s:ScatterViewItem">
<EventSetter Event="s:SurfaceDragDrop.Drop" Handler="Scatter_Drop"/>
<Setter Property="AllowDrop" Value="True" />
</Style>
</s:ScatterView.ItemContainerStyle>
</s:ScatterView>
와의 SurfaceListBox
:
AllowDrop
를 설정하고 각
ScatterViewItem
대한 드롭 이벤트 핸들러를 연결해야
<s:SurfaceListBox
x:Name="listBoxList"
Background="{x:Null}">
<s:SurfaceListBox.ItemContainerStyle>
<Style TargetType="s:SurfaceListBox">
<EventSetter Event="s:SurfaceDragDrop.Drop" Handler="ListBox_Drop"/>
<Setter Property="AllowDrop" Value="True" />
</Style>
</s:SurfaceListBox.ItemContainerStyle>
</s:SurfaceListBox>
에 반대하지만, 그것을 할 수있는 적절한 방법을 보이지 않는. 50 개 항목이 있다면 나는 50 개 항목이 아닌 하나의 드롭 이벤트를 가져야합니다. 여기에 뭔가 빠져 있다면 저에게 계몽하십시오. –
모든 항목을 정확히 동일한 이벤트 처리기 기능을 가리 키도록 할 수 있지만 각 항목에는 AllowDrop이 직접 설정되어 있어야합니다. –
로버트에게 정보를 제공해 주셔서 감사 드리며 해결책은 첫 번째 게시물에 있습니다. –