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); } } }
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); }
private static void OnHorizontalPositionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { DropMarkAdorner adorner = sender as DropMarkAdorner; if (adorner == null) { return; } adorner.UpdatePosition(); }
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 = Xceed.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); }
internal void ShowDropMark(RelativePoint mousePosition) { if (m_dropMarkAdorner == null) { var dataGridContext = DataGridControl.GetDataGridContext(this); var dataGridControl = (dataGridContext != null) ? dataGridContext.DataGridControl : null; var pen = UIViewBase.GetDropMarkPen(this); if ((pen == null) && (dataGridControl != null)) { var uiViewBase = dataGridControl.GetView() as UIViewBase; if (uiViewBase != null) { pen = uiViewBase.DefaultDropMarkPen; } } var orientation = UIViewBase.GetDropMarkOrientation(this); if ((orientation == DropMarkOrientation.Default) && (dataGridControl != null)) { var uiViewBase = dataGridControl.GetView() as UIViewBase; if (uiViewBase != null) { orientation = uiViewBase.DefaultDropMarkOrientation; } } m_dropMarkAdorner = new DropMarkAdorner(this, pen, orientation); var 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 ); } }
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 ); }
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 ); }
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 = Xceed.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 ); } }