コード例 #1
0
        protected override void OnDrop(DragEventArgs e)
        {
            base.OnDrop(e);

            IsDraggingAfter  = false;
            IsDraggingBefore = false;

            SearchPanelItemContainer container = e.Data.GetData(typeof(SearchPanelItemContainer)) as SearchPanelItemContainer;

            if (container != null && container != this)
            {
                searchPanel.MoveItem(container.CurrentItem, this.CurrentItem);
            }
        }
コード例 #2
0
        protected override void OnDragEnter(DragEventArgs e)
        {
            SearchPanelItemContainer container = e.Data.GetData(typeof(SearchPanelItemContainer)) as SearchPanelItemContainer;

            if (container != null && container != this)
            {
                if (searchPanel.Items.IndexOf(this.CurrentItem) > searchPanel.Items.IndexOf(container.CurrentItem))
                {
                    IsDraggingAfter  = true;
                    IsDraggingBefore = false;
                }
                else
                {
                    IsDraggingAfter  = false;
                    IsDraggingBefore = true;
                }
            }
        }
コード例 #3
0
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            SearchPanelItemContainer container = element as SearchPanelItemContainer;

            SearchPanelItem searchItem = item as SearchPanelItem;

            container.CurrentItem = searchItem;
            searchItem.Container  = container;

            if (searchItem.IsActive)
            {
                container.Visibility = Visibility.Visible;
            }
            else
            {
                container.Visibility = Visibility.Collapsed;
            }
        }