Пример #1
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            LLMListViewItem item = new LLMListViewItem();

            SetItemBinding(item, LLMListViewItem.LeftSwipeModeProperty, "ItemLeftSwipeMode");
            SetItemBinding(item, LLMListViewItem.RightSwipeModeProperty, "ItemRightSwipeMode");
            SetItemBinding(item, LLMListViewItem.BackAnimDurationProperty, "ItemBackAnimDuration");
            SetItemBinding(item, LLMListViewItem.LeftBackAnimEasingFunctionProperty, "ItemLeftBackAnimEasingFunction");
            SetItemBinding(item, LLMListViewItem.RightBackAnimEasingFunctionProperty, "ItemRightBackAnimEasingFunction");
            SetItemBinding(item, LLMListViewItem.LeftSwipeContentTemplateProperty, "ItemLeftSwipeContentTemplate");
            SetItemBinding(item, LLMListViewItem.RightSwipeContentTemplateProperty, "ItemRightSwipeContentTemplate");
            SetItemBinding(item, LLMListViewItem.LeftSwipeLengthRateProperty, "ItemLeftSwipeLengthRate");
            SetItemBinding(item, LLMListViewItem.LeftActionRateForSwipeLengthProperty, "ItemLeftActionRateForSwipeLength");
            SetItemBinding(item, LLMListViewItem.RightSwipeLengthRateProperty, "ItemRightSwipeLengthRate");
            SetItemBinding(item, LLMListViewItem.RightActionRateForSwipeLengthProperty, "ItemRightActionRateForSwipeLength");
            SetItemBinding(item, LLMListViewItem.LeftSwipeMaxLengthProperty, "ItemLeftSwipeMaxLength");
            SetItemBinding(item, LLMListViewItem.RightSwipeMaxLengthProperty, "ItemRightSwipeMaxLength");
            SetItemBinding(item, LLMListViewItem.IsSwipeEnabledProperty, "IsItemSwipeEnabled");
            SetItemBinding(item, LLMListViewItem.IsSwipedRightMemberPathProperty, "IsSwipedRightMemberPath");
            SetItemBinding(item, LLMListViewItem.IsSwipedLeftMemberPathProperty, "IsSwipedLeftMemberPath");
            SetItemBinding(item, LLMListViewItem.EnableSwipeRightMemberPathProperty, "EnableSwipeRightMemberPath");
            SetItemBinding(item, LLMListViewItem.EnableSwipeLeftMemberPathProperty, "EnableSwipeLeftMemberPath");

            item.SwipeBeginInTouch    += Item_SwipeBeginInTouch;
            item.SwipeProgressInTouch += Item_SwipeProgressInTouch;
            item.SwipeRestoreComplete += Item_SwipeStoreComplete;
            item.SwipeTriggerComplete += Item_SwipeTriggerComplete;
            item.SwipeBeginTrigger    += Item_SwipeBeginTrigger;
            item.SwipeBeginRestore    += Item_SwipeBeginRestore;
            item.SwipeTriggerInTouch  += Item_SwipeTriggerInTouch;
            return(item);
        }
Пример #2
0
        private void SetItemBinding(LLMListViewItem item, DependencyProperty originProperty, string targetProperty)
        {
            var binding = new Binding()
            {
                Source = this, Path = new PropertyPath(targetProperty)
            };

            BindingOperations.SetBinding(item, originProperty, binding);
        }