Esempio n. 1
0
        private static void ApplyStyle(DataGridColumnStyleCollection styles, DependencyObject column)
        {
            var style = styles.FirstOrDefault(s => s.ColumnType == column.GetType());

            if (style == null)
            {
                return;
            }

            SetStyleBinding(column, DataGridColumnStyle.ElementStyleProperty, style);
            SetStyleBinding(column, DataGridColumnStyle.EditingElementStyleProperty, style);
        }
Esempio n. 2
0
        private static void ApplyStyle([NotNull, ItemNotNull] DataGridColumnStyleCollection styles, [NotNull] DependencyObject column)
        {
            Contract.Requires(styles != null);
            Contract.Requires(column != null);

            var style = styles.FirstOrDefault(s => s.ColumnType == column.GetType());

            if (style == null)
            {
                return;
            }

            SetStyleBinding(column, DataGridColumnStyle.ElementStyleProperty, style);
            SetStyleBinding(column, DataGridColumnStyle.EditingElementStyleProperty, style);
        }