Having ListView, how can I get the index in the list where the item from the same list was dropped?(Reordering) I tried using the following callbacks, but neither DragItemsCompletedEventArgs
or OnDropIntoStagedPhotos
seem to have an appropriate method.
void TableContentPage::OnStagedDragItemsCompleted(
[[maybe_unused]] ::winrt::Windows::Foundation::IInspectable const &,
[[maybe_unused]] ::winrt::Microsoft::UI::Xaml::Controls::
DragItemsCompletedEventArgs const &args)
{
}
void TableContentPage::OnDropIntoStagedPhotos(
[[maybe_unused]] Windows::Foundation::IInspectable const &sender,
[[maybe_unused]] Microsoft::UI::Xaml::DragEventArgs const &args)
{
}
I'm using the following ListView attributes:
<ListView x:Name="ListViewName"
Grid.Row="0"
Grid.Column="0"
ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.IsHorizontalRailEnabled="True"
CanDragItems="True"
CanReorderItems="True"
IsSwipeEnabled="True"
HorizontalAlignment="Stretch"
AllowDrop="True"
Background="{StaticResource PrimaryColor}"
Drop="OnDropIntoStagedPhotos"
DragOver="OnDragOverStagedPhotos"
DragItemsCompleted="OnStagedDragItemsCompleted"
DragItemsStarting="OnStagedDragItemsStarting"
SelectionMode="Extended"
SelectionChanged="OnStagedPhotosSelectionChanged">