internal void ShowFarDropMark(Point mousePosition)
        {
            int itemsCount = this.Items.Count;

            if (itemsCount < 1)
            {
                if (m_dropMarkAdorner == null)
                {
                    DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this);

                    DataGridControl grid = (dataGridContext != null)
            ? dataGridContext.DataGridControl
            : null;

                    Pen pen = UIViewBase.GetDropMarkPen(this);

                    if ((pen == null) && (grid != null))
                    {
                        UIViewBase uiViewBase = grid.GetView() as UIViewBase;
                        pen = uiViewBase.DefaultDropMarkPen;
                    }

                    DropMarkOrientation orientation = UIViewBase.GetDropMarkOrientation(this);

                    if ((orientation == DropMarkOrientation.Default) && (grid != null))
                    {
                        UIViewBase uiViewBase = grid.GetView() as UIViewBase;

                        orientation = uiViewBase.DefaultDropMarkOrientation;
                    }

                    m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation);

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                    if (adornerLayer != null)
                    {
                        adornerLayer.Add(m_dropMarkAdorner);
                    }
                }
                // We Only want the drop mark to be displayed at the end of the HierarchicalGroupByControlNode
                m_dropMarkAdorner.ForceAlignment(DropMarkAlignment.Far);
            }
            else
            {
                HierarchicalGroupByItem hierarchicalGroupByItem = this.ItemContainerGenerator.ContainerFromIndex(itemsCount - 1) as HierarchicalGroupByItem;

                Debug.Assert(hierarchicalGroupByItem != null);

                GroupLevelDescription groupLevelDescription = hierarchicalGroupByItem.Content as GroupLevelDescription;

                Debug.Assert(groupLevelDescription != null);

                // Show Far DropMark only if not already grouped
                if (this.Items.Contains(groupLevelDescription) == false)
                {
                    hierarchicalGroupByItem.ShowFarDropMark(mousePosition);
                }
            }
        }
示例#2
0
        internal void ShowDropMark(Point mousePosition)
        {
            if (m_dropMarkAdorner == null)
            {
                var dataGridContext = this.DataGridContext;
                var grid            = (dataGridContext != null) ? dataGridContext.DataGridControl : null;

                Pen pen = UIViewBase.GetDropMarkPen(this);

                if ((pen == null) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;
                    pen = uiViewBase.DefaultDropMarkPen;
                }

                DropMarkOrientation orientation = UIViewBase.GetDropMarkOrientation(this);

                if ((orientation == DropMarkOrientation.Default) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;
                    orientation = uiViewBase.DefaultDropMarkOrientation;
                }

                m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation);

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    adornerLayer.Add(m_dropMarkAdorner);
                }
            }

            m_dropMarkAdorner.UpdateAlignment(mousePosition);
        }
示例#3
0
        private static void OnHorizontalPositionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            DropMarkAdorner adorner = sender as DropMarkAdorner;

            if (adorner == null)
            {
                return;
            }

            adorner.UpdatePosition();
        }
示例#4
0
        private void ShowDropMark(Point mousePosition, DropMarkAlignment defaultAlignment, bool forceDefaultAlignment)
        {
            if (m_dropMarkAdorner == null)
            {
                DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this);

                DataGridControl grid = (dataGridContext != null)
          ? dataGridContext.DataGridControl
          : null;

                Pen pen = UIViewBase.GetDropMarkPen(this);

                if ((pen == null) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;
                    pen = uiViewBase.DefaultDropMarkPen;
                }

                DropMarkOrientation orientation = Nequeo.Wpf.DataGrid.Views.UIViewBase.GetDropMarkOrientation(this);

                if ((orientation == DropMarkOrientation.Default) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;

                    orientation = uiViewBase.DefaultDropMarkOrientation;
                }

                m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation);

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    adornerLayer.Add(m_dropMarkAdorner);
                }
            }

            if (forceDefaultAlignment)
            {
                m_dropMarkAdorner.ForceAlignment(defaultAlignment);
            }
            else
            {
                m_dropMarkAdorner.UpdateAlignment(mousePosition);
            }
        }
示例#5
0
        private void ShowFarDropMark()
        {
            if (m_dropMarkAdorner == null)
            {
                DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this);

                DataGridControl grid = (dataGridContext != null)
          ? dataGridContext.DataGridControl
          : null;

                Pen pen = Nequeo.Wpf.DataGrid.Views.UIViewBase.GetDropMarkPen(this);

                if ((pen == null) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;
                    pen = uiViewBase.DefaultDropMarkPen;
                }

                DropMarkOrientation orientation = UIViewBase.GetDropMarkOrientation(this);

                if ((orientation == DropMarkOrientation.Default) && (grid != null))
                {
                    UIViewBase uiViewBase = grid.GetView() as UIViewBase;

                    orientation = uiViewBase.DefaultDropMarkOrientation;
                }

                m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation);

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    adornerLayer.Add(m_dropMarkAdorner);
                }
            }

            // We Only want the drop mark to be displayed at the end of the HierarchicalGroupByControlNode
            m_dropMarkAdorner.ForceAlignment(DropMarkAlignment.Far);
        }