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); }
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); } } }
// A null value for the pen parameter means that the adorner will not show any visual cue. public DropMarkAdorner( UIElement adornedElement, Pen pen, DropMarkOrientation orientation ) : base( adornedElement ) { Debug.Assert( orientation != DropMarkOrientation.Default, "A DropMarkAdorner without a specific orientation should virtually never happen. The only known way to do this would be to have a grid element not hosted in a DataGridControl. The DropMarkAdorner should react well to this nonetheless." ); m_pen = pen; m_orientation = orientation; this.IsHitTestVisible = false; }
// A null value for the pen parameter means that the adorner will not show any visual cue. public DropMarkAdorner(UIElement adornedElement, Pen pen, DropMarkOrientation orientation) : base(adornedElement) { Debug.Assert(orientation != DropMarkOrientation.Default, "A DropMarkAdorner without a specific orientation should virtually never happen. The only known way to do this would be to have a grid element not hosted in a DataGridControl. The DropMarkAdorner should react well to this nonetheless."); m_pen = pen; m_orientation = orientation; this.IsHitTestVisible = false; }
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); } }
private void ShowFarDropMark() { if (m_dropMarkAdorner == null) { DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this); DataGridControl grid = (dataGridContext != null) ? dataGridContext.DataGridControl : null; Pen pen = Xceed.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); }
public static void SetDropMarkOrientation(DependencyObject obj, DropMarkOrientation value) { obj.SetValue(UIViewBase.DropMarkOrientationProperty, value); }
public static void SetDropMarkOrientation( DependencyObject obj, DropMarkOrientation value ) { obj.SetValue( UIViewBase.DropMarkOrientationProperty, value ); }