LLMListView icon indicating copy to clipboard operation
LLMListView copied to clipboard

How to use LLMListViewItem.RightSwipeMaxLength Property in MVVM usecase

Open deepak-rathi opened this issue 8 years ago • 5 comments

Hi,

I want to use LLMListView for Swipe mode "Fix". I have three buttons in ItemRightSwipeContentTemplate.

LLMListView ItemSource is binded to "MyCustomClass" list collection.

"MyCustomClass" has a boolean property "IsVisible".

If "IsVisible" is true I show one button, else I show two button.

If i set LLMListView .ItemRightSwipeMaxLength="180" in xaml, and if user do right to left swipe.

In case of two button visible, If a user want to reset the LLMListViewItem by moving left to right on same listview item after following above step, this can be done from any visible part of LLMListViewItem.

But when only one button is visible, there a gap in between LLMListViewItem and Button from ItemRightSwipeContent due to LLMListView .ItemRightSwipeMaxLength value (180).

So I want to bind LLMListViewItem.RightSwipeLength property with "IsVisible" taking help of a IsVisibleToItemSwipeMaxLengthConverter which set different ItemRightSwipeMaxLength based on "IsVisible".

How can I do that??

Thanks in advance.

deepak-rathi avatar Aug 29 '17 11:08 deepak-rathi

try this: https://github.com/brookshi/LLMListView/issues/4

brookshi avatar Aug 29 '17 13:08 brookshi

I tried that but it apply changes on next swipe and swipe fix mode feature break if RightSwipeLength value is set to 80.

deepak-rathi avatar Aug 29 '17 14:08 deepak-rathi

show me the code please.

brookshi avatar Aug 29 '17 15:08 brookshi

Complete source code: https://github.com/deepak-rathi/LLMListView-Sample

Uncomment code in MainPage.xaml.cs/LLMListView_ItemSwipeBeginTrigger function to see #4 solution didn't worked.

Main issue, swipe not working in this area: https://github.com/deepak-rathi/LLMListView-Sample/blob/master/Swipe_not_working_area.PNG (image)

deepak-rathi avatar Aug 30 '17 05:08 deepak-rathi

Your code looks OK. LLMListView doesn't match your requirement, you should find another Listview library.

brookshi avatar Aug 30 '17 12:08 brookshi