UWP ListView에서 CanReorderItems가 true로 설정된 경우 DragItemsCompleted 및 DragItemsStarting 이벤트가 발생하지 않는 이유는 무엇입니까?

Citelao

<ListView>사용자가 끌어서 놓기를 통해 재정렬하기를 원하는 UWP XAML 이 있습니다. ListViewBase CanReorderItems속성 은 해당 기능을 제공하며 몇 가지 속성 만 필요합니다.

<ListView ItemsSource="{x:Bind Items}"
    CanReorderItems="True"
    AllowDrop="True"
    DragItemsStarting="ListView_DragItemsStarting"
    DragItemsCompleted="ListView_DragItemsCompleted">
    <!-- ... -->
</ListView>

이렇게하면 ListView 내에서 항목을 끌어서 놓을 수 있으며 (제거 후 추가) CollectionChanged에서 이벤트 가 발생 합니다 ItemsSource. 그러나 DragItemsStartingDragItemsCompleted이벤트 는 발생하지 않습니다 .

이러한 이벤트를 사용하면 .NET Framework의 두 CollectionChanged이벤트에 의존하는 대신 원자 적으로 드래그를 처리 할 수 ItemsSource있습니다.

이러한 이벤트를 발생 시키려면 어떻게해야합니까?

Citelao

ListViewS는 발생하지 않습니다 DragItemsStartingDragItemsCompleted하지 않는 이벤트 CanDragItemsListView에 true로 설정됩니다

<ListView ItemsSource="{x:Bind Items}"
    CanDragItems="True"
    CanReorderItems="True"
    AllowDrop="True"
    DragItemsStarting="ListView_DragItemsStarting"
    DragItemsCompleted="ListView_DragItemsCompleted">
    <!-- ... -->
</ListView>

이 속성을 추가하면 이러한 이벤트가 실행된다는 것을 알 수 있습니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관