Closed EmilAlipiev closed 4 years ago
Hi @EmilAlipiev, thanks for reaching out! This is good question. As you said, this feature is currently missing from the Tizen implementation. We’re internally working on some ideas to make it possible to select items through long press and perform user-defined action. We’ll share them soon. Thanks! 🤙
*update Of course, even now you can implement it by using the ContextPopupEffectBehavior together in the app, but we are discussing to provide the function with the listview/cell itself for better usability.
@rookiejava thanks for the suggestion. I try to implement like in the XUIComponents sample
ItemLongPressed is defined on GenList in ElmSharp namespace. i thought CircleListView inherits from xamarin.listview. How does it work together with GenList ? I am able to bind Command but somehow Commandparameter doesnt work for me.
So i have implemented like below. can I expect a the single item as I long press on a single item on the list? or effect:ItemLongPressEffect Command is executed on the entire CircleListView ? so it will return all Items as Commandparameter?
<cui:CircleListView x:Name="List"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
AbsoluteLayout.LayoutFlags="All"
IsGroupingEnabled="True"
HasUnevenRows="True"
GroupDisplayBinding="{Binding Key}"
ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem}"
effect:ItemLongPressEffect.Command="{Binding Path=BindingContext.LongClickCommand, Source={x:Reference Name=List}}"
effect:ItemLongPressEffect.CommandParameter="{Binding .}">
public Command LongClickCommand
{
get
{
return new Command<Item>((item) =>
{
});
}
}
I have tried to implement it also Grid inside viewcell as below using {Binding .} but i am not able to get the current item as Commandparameter. I am not sure if there is a problem with Commandparameter implementation.
<cui:CircleListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
BackgroundColor="Transparent"
effect:ItemLongPressEffect.Command="{Binding Path=BindingContext.LongClickCommand, Source={x:Reference Name=List}}"
effect:ItemLongPressEffect.CommandParameter="{Binding .}">
I cannot figure out if ContextActions working for CircularListView or not? I simply tried like below but nothing happening. What is the best way to delete an item from the list? is there any contextactions or long holding action?