コード例 #1
0
        private static void OnHeaderStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridRowGroupHeader groupHeader = d as DataGridRowGroupHeader;

            if (groupHeader.HeaderElement != null)
            {
                groupHeader.HeaderElement.EnsureStyle(e.OldValue as Style);
            }
        }
コード例 #2
0
        private static void OnSublevelIndentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridRowGroupHeader groupHeader = d as DataGridRowGroupHeader;
            double newValue = (double)e.NewValue;

            // We don't need to revert to the old value if our input is bad because we never read this property value
            if (double.IsNaN(newValue))
            {
                throw DataGridError.DataGrid.ValueCannotBeSetToNAN("SublevelIndent");
            }
            else if (double.IsInfinity(newValue))
            {
                throw DataGridError.DataGrid.ValueCannotBeSetToInfinity("SublevelIndent");
            }
            else if (newValue < 0)
            {
                throw DataGridError.DataGrid.ValueMustBeGreaterThanOrEqualTo("value", "SublevelIndent", 0);
            }

            if (groupHeader.OwningGrid != null)
            {
                groupHeader.OwningGrid.OnSublevelIndentUpdated(groupHeader, newValue);
            }
        }
コード例 #3
0
        private static void OnPropertyValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DataGridRowGroupHeader groupHeader = d as DataGridRowGroupHeader;

            groupHeader.UpdateTitleElements();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataGridRowGroupHeaderEventArgs"/> class.
 /// </summary>
 /// <param name="rowGroupHeader">The row group header that the event occurs for.</param>
 public DataGridRowGroupHeaderEventArgs(DataGridRowGroupHeader rowGroupHeader)
 {
     this.RowGroupHeader = rowGroupHeader;
 }