private void SyncProperties(FrameworkElement e)
 {
     DataGridHelper.SyncColumnProperty(this, e, TextElement.FontFamilyProperty, FontFamilyProperty);
     DataGridHelper.SyncColumnProperty(this, e, TextElement.FontSizeProperty, FontSizeProperty);
     DataGridHelper.SyncColumnProperty(this, e, TextElement.FontStyleProperty, FontStyleProperty);
     DataGridHelper.SyncColumnProperty(this, e, TextElement.FontWeightProperty, FontWeightProperty);
     DataGridHelper.SyncColumnProperty(this, e, TextElement.ForegroundProperty, ForegroundProperty);
 }
Beispiel #2
0
 // Token: 0x060048B7 RID: 18615 RVA: 0x0014A3E4 File Offset: 0x001485E4
 private void ApplyColumnProperties(ComboBox comboBox)
 {
     DataGridComboBoxColumn.ApplyBinding(this.SelectedItemBinding, comboBox, Selector.SelectedItemProperty);
     DataGridComboBoxColumn.ApplyBinding(this.SelectedValueBinding, comboBox, Selector.SelectedValueProperty);
     DataGridComboBoxColumn.ApplyBinding(this.TextBinding, comboBox, ComboBox.TextProperty);
     DataGridHelper.SyncColumnProperty(this, comboBox, Selector.SelectedValuePathProperty, DataGridComboBoxColumn.SelectedValuePathProperty);
     DataGridHelper.SyncColumnProperty(this, comboBox, ItemsControl.DisplayMemberPathProperty, DataGridComboBoxColumn.DisplayMemberPathProperty);
     DataGridHelper.SyncColumnProperty(this, comboBox, ItemsControl.ItemsSourceProperty, DataGridComboBoxColumn.ItemsSourceProperty);
 }
Beispiel #3
0
        private void ApplyColumnProperties(ComboBox comboBox)
        {
            ApplyBinding(SelectedItemBinding, comboBox, ComboBox.SelectedItemProperty);
            ApplyBinding(SelectedValueBinding, comboBox, ComboBox.SelectedValueProperty);
            ApplyBinding(TextBinding, comboBox, ComboBox.TextProperty);

            DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.SelectedValuePathProperty, SelectedValuePathProperty);
            DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.DisplayMemberPathProperty, DisplayMemberPathProperty);
            DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.ItemsSourceProperty, ItemsSourceProperty);
        }
Beispiel #4
0
        protected internal override void RefreshCellContent(FrameworkElement element, string propertyName)
        {
            DataGridCell cell = element as DataGridCell;

            if (cell != null)
            {
                bool isCellEditing = cell.IsEditing;
                if ((string.Compare(propertyName, "ElementStyle", StringComparison.Ordinal) == 0 && !isCellEditing) ||
                    (string.Compare(propertyName, "EditingElementStyle", StringComparison.Ordinal) == 0 && isCellEditing))
                {
                    cell.BuildVisualTree();
                }
                else
                {
                    ComboBox comboBox = cell.Content as ComboBox;
                    switch (propertyName)
                    {
                    case "SelectedItemBinding":
                        ApplyBinding(SelectedItemBinding, comboBox, ComboBox.SelectedItemProperty);
                        break;

                    case "SelectedValueBinding":
                        ApplyBinding(SelectedValueBinding, comboBox, ComboBox.SelectedValueProperty);
                        break;

                    case "TextBinding":
                        ApplyBinding(TextBinding, comboBox, ComboBox.TextProperty);
                        break;

                    case "SelectedValuePath":
                        DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.SelectedValuePathProperty, SelectedValuePathProperty);
                        break;

                    case "DisplayMemberPath":
                        DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.DisplayMemberPathProperty, DisplayMemberPathProperty);
                        break;

                    case "ItemsSource":
                        DataGridHelper.SyncColumnProperty(this, comboBox, ComboBox.ItemsSourceProperty, ItemsSourceProperty);
                        break;

                    default:
                        base.RefreshCellContent(element, propertyName);
                        break;
                    }
                }
            }
            else
            {
                base.RefreshCellContent(element, propertyName);
            }
        }
Beispiel #5
0
        /// <summary>Refreshes the contents of a cell in the column in response to a binding change.</summary>
        /// <param name="element">The cell to update.</param>
        /// <param name="propertyName">The name of the column property that has changed.</param>
        // Token: 0x060048B3 RID: 18611 RVA: 0x0014A240 File Offset: 0x00148440
        protected internal override void RefreshCellContent(FrameworkElement element, string propertyName)
        {
            DataGridCell dataGridCell = element as DataGridCell;

            if (dataGridCell == null)
            {
                base.RefreshCellContent(element, propertyName);
                return;
            }
            bool isEditing = dataGridCell.IsEditing;

            if ((string.Compare(propertyName, "ElementStyle", StringComparison.Ordinal) == 0 && !isEditing) || (string.Compare(propertyName, "EditingElementStyle", StringComparison.Ordinal) == 0 && isEditing))
            {
                dataGridCell.BuildVisualTree();
                return;
            }
            ComboBox comboBox = dataGridCell.Content as ComboBox;

            if (propertyName == "SelectedItemBinding")
            {
                DataGridComboBoxColumn.ApplyBinding(this.SelectedItemBinding, comboBox, Selector.SelectedItemProperty);
                return;
            }
            if (propertyName == "SelectedValueBinding")
            {
                DataGridComboBoxColumn.ApplyBinding(this.SelectedValueBinding, comboBox, Selector.SelectedValueProperty);
                return;
            }
            if (propertyName == "TextBinding")
            {
                DataGridComboBoxColumn.ApplyBinding(this.TextBinding, comboBox, ComboBox.TextProperty);
                return;
            }
            if (propertyName == "SelectedValuePath")
            {
                DataGridHelper.SyncColumnProperty(this, comboBox, Selector.SelectedValuePathProperty, DataGridComboBoxColumn.SelectedValuePathProperty);
                return;
            }
            if (propertyName == "DisplayMemberPath")
            {
                DataGridHelper.SyncColumnProperty(this, comboBox, ItemsControl.DisplayMemberPathProperty, DataGridComboBoxColumn.DisplayMemberPathProperty);
                return;
            }
            if (!(propertyName == "ItemsSource"))
            {
                base.RefreshCellContent(element, propertyName);
                return;
            }
            DataGridHelper.SyncColumnProperty(this, comboBox, ItemsControl.ItemsSourceProperty, DataGridComboBoxColumn.ItemsSourceProperty);
        }
        /// <summary>Refreshes the contents of a cell in the column in response to a column property value change.</summary>
        /// <param name="element">The cell to update.</param>
        /// <param name="propertyName">The name of the column property that has changed.</param>
        // Token: 0x060049B6 RID: 18870 RVA: 0x0014D6C4 File Offset: 0x0014B8C4
        protected internal override void RefreshCellContent(FrameworkElement element, string propertyName)
        {
            DataGridCell dataGridCell = element as DataGridCell;

            if (dataGridCell != null)
            {
                FrameworkElement frameworkElement = dataGridCell.Content as FrameworkElement;
                if (frameworkElement != null)
                {
                    if (!(propertyName == "FontFamily"))
                    {
                        if (!(propertyName == "FontSize"))
                        {
                            if (!(propertyName == "FontStyle"))
                            {
                                if (!(propertyName == "FontWeight"))
                                {
                                    if (propertyName == "Foreground")
                                    {
                                        DataGridHelper.SyncColumnProperty(this, frameworkElement, TextElement.ForegroundProperty, DataGridTextColumn.ForegroundProperty);
                                    }
                                }
                                else
                                {
                                    DataGridHelper.SyncColumnProperty(this, frameworkElement, TextElement.FontWeightProperty, DataGridTextColumn.FontWeightProperty);
                                }
                            }
                            else
                            {
                                DataGridHelper.SyncColumnProperty(this, frameworkElement, TextElement.FontStyleProperty, DataGridTextColumn.FontStyleProperty);
                            }
                        }
                        else
                        {
                            DataGridHelper.SyncColumnProperty(this, frameworkElement, TextElement.FontSizeProperty, DataGridTextColumn.FontSizeProperty);
                        }
                    }
                    else
                    {
                        DataGridHelper.SyncColumnProperty(this, frameworkElement, TextElement.FontFamilyProperty, DataGridTextColumn.FontFamilyProperty);
                    }
                }
            }
            base.RefreshCellContent(element, propertyName);
        }
        protected internal override void RefreshCellContent(FrameworkElement element, string propertyName)
        {
            DataGridCell cell = element as DataGridCell;

            if (cell != null)
            {
                FrameworkElement textElement = cell.Content as FrameworkElement;

                if (textElement != null)
                {
                    switch (propertyName)
                    {
                    case "FontFamily":
                        DataGridHelper.SyncColumnProperty(this, textElement, TextElement.FontFamilyProperty, FontFamilyProperty);
                        break;

                    case "FontSize":
                        DataGridHelper.SyncColumnProperty(this, textElement, TextElement.FontSizeProperty, FontSizeProperty);
                        break;

                    case "FontStyle":
                        DataGridHelper.SyncColumnProperty(this, textElement, TextElement.FontStyleProperty, FontStyleProperty);
                        break;

                    case "FontWeight":
                        DataGridHelper.SyncColumnProperty(this, textElement, TextElement.FontWeightProperty, FontWeightProperty);
                        break;

                    case "Foreground":
                        DataGridHelper.SyncColumnProperty(this, textElement, TextElement.ForegroundProperty, ForegroundProperty);
                        break;
                    }
                }
            }

            base.RefreshCellContent(element, propertyName);
        }