Font property

Grids for WPF Forum

Posted 8 years ago by Eli Obadia
Version: 10.2.0532
Avatar
I'm working with SelectedObject="{Binding}".
I have a property taht is Font and I want the end user to type the font or to choose from a combobox with the different fonts I wrote

<summary>
        /// Gets or sets the font family.
        /// </summary>
        /// <value>The font family.</value>
        [Category("Font/Text")]
        [Description("The font family.")]
        public FontFamily FontFamily
        {
            get
            {
                return this.fontFamily;
            }
            set
            {
                if (value != this.fontFamily)
                {
                    this.fontFamily = value;
                }
            }
        }
However I don't get the combobox is there any predefined editor or I have to program a custom made editor? (I think it is so common that there should be a way without programming myself)

The same situation I have with 2 more properties:
1) FontStyle (comobobox with normal, italic....)
2) Color I would like a combobox with the colors # and name.

Comments (3)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eli,

We don't currently have built-in editors for FontFamily/FontStyle, so you'd have to build a custom property editor for those properties. I've marked down a TODO item to see about adding this support in the future.

You can leverage the ColorEditBox and/or BrushEditBox to provide color selection using the Editors/PropertyGrid Interop assembly.


Actipro Software Support

Posted 6 years ago by Bartek Gloger
Avatar

Hi, Is there any progress on a font editor in the property grid? Should be quickly implemented as you have a nice one already in the ribbon... Regards, Bartek

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Bartek,

Sorry but we haven't done anything with that.  A font family property editor could be added on your own though with a custom editor just by having a ComboBox in the template that is bound to the available system font families.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.