Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143454 | Mar 20,2019 05:05 PM UTC | Apr 15,2019 12:06 PM UTC | Xamarin.Forms | 9 |
![]() |
Tags: SfCarousel |
<ContentPage>
<Grid>
<syncfusion:SfListView x:Name="ToDoListView"
ItemsSource="{Binding ToDoList}"
DragStartMode="OnHold,OnDragIndicator">
</syncfusion:SfListView>
<syncfusion:SfListView x:Name="WorkDoneListView"
ItemsSource="{Binding NewList}"
DragStartMode="OnHold,OnDragIndicator">
</syncfusion:SfListView>
</Grid>
</ContentPage> |
private async void WorkDoneListView_ItemDragging(object sender, ItemDraggingEventArgs e)
{
var position = new Point();
var xPosition = e.Position.X;
double yPosition = e.Position.Y;
position.X = xPosition;
position.Y = yPosition;
if (e.Action == DragAction.Dragging)
{
if (this.ToDoListView.Bounds.Contains(position))
this.ToDoListView.BackgroundColor = Color.Red;
else
this.ToDoListView.BackgroundColor = Color.White;
}
if (e.Action == DragAction.Drop)
{
if (this.ToDoListView.Bounds.Contains(position))
{
var item = e.ItemData as ToDoItem;
await Task.Delay(100);
viewModel.NewList.Remove(item);
viewModel.ToDoList.Add(item);
item.IsDone = false;
}
this.ToDoListView.BackgroundColor = Color.White;
}
}
private async void ToDoListView_ItemDragging(object sender, ItemDraggingEventArgs e)
{
var position = new Point();
var xPosition = e.Position.X;
double yPosition = e.Position.Y;
position.X = xPosition;
position.Y = yPosition;
if (e.Action == DragAction.Dragging)
{
if (this.WorkDoneListView.Bounds.Contains(position))
this.WorkDoneListView.BackgroundColor = Color.Red;
else
this.WorkDoneListView.BackgroundColor = Color.White;
}
if (e.Action == DragAction.Drop)
{
if (this.WorkDoneListView.Bounds.Contains(position))
{
var item = e.ItemData as ToDoItem;
await Task.Delay(100);
viewModel.ToDoList.Remove(item);
viewModel.NewList.Add(item);
item.IsDone = true;
}
this.WorkDoneListView.BackgroundColor = Color.White;
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.