/// <summary>
        /// Creates a text block control with data binding.
        /// </summary>
        /// <param name="d">The cell definition.</param>
        /// <returns>
        /// A TextBlock.
        /// </returns>
        protected virtual FrameworkElement CreateTextBlockControl(CellDefinition d)
        {
            var c = new TextBlockEx
            {
                HorizontalAlignment = d.HorizontalAlignment,
                VerticalAlignment   = VerticalAlignment.Center,
                Padding             = new Thickness(4, 0, 4, 0)
            };

            c.SetBinding(TextBlock.TextProperty, this.CreateOneWayBinding(d));
            this.SetIsEnabledBinding(d, c);

            return(this.CreateContainer(d, c));
        }
        /// <summary>
        /// Creates a text block control for a selector cell.
        /// </summary>
        /// <param name="d">The cell definition.</param>
        /// <returns>
        /// A TextBlock.
        /// </returns>
        protected virtual FrameworkElement CreateTextBlockControl(SelectorCellDefinition d)
        {
            var c = new TextBlockEx
            {
                HorizontalAlignment = d.HorizontalAlignment,
                VerticalAlignment   = VerticalAlignment.Center,
                Padding             = new Thickness(4, 0, 4, 0)
            };

            var binding = this.CreateOneWayBinding(d);

            if (!string.IsNullOrEmpty(d.DisplayMemberPath) && string.IsNullOrEmpty(d.SelectedValuePath))
            {
                binding.Path.Path += "." + d.DisplayMemberPath;
            }

            c.SetBinding(TextBlock.TextProperty, binding);
            this.SetIsEnabledBinding(d, c);

            return(this.CreateContainer(d, c));
        }
        /// <summary>
        /// Creates a text block control with data binding.
        /// </summary>
        /// <param name="d">The cell definition.</param>
        /// <returns>
        /// A TextBlock.
        /// </returns>
        protected virtual FrameworkElement CreateTextBlockControl(CellDefinition d)
        {
            var c = new TextBlockEx
            {
                HorizontalAlignment = d.HorizontalAlignment,
                VerticalAlignment = VerticalAlignment.Center,
                Padding = new Thickness(4, 0, 4, 0)
            };

            c.SetBinding(TextBlock.TextProperty, this.CreateOneWayBinding(d));
            this.SetIsEnabledBinding(d, c);

            var grid = new Grid();
            grid.Children.Add(c);
            this.SetBackgroundBinding(d, grid);
            this.SetIsEnabledBinding(d, grid);
            return grid;
        }