CategoryEditor' DisplayName localization

Docking/MDI for WPF Forum

The latest build of this product (v25.1.2) was released 2 days ago, which was before this thread was created.
Posted 18 hours ago by Procam
Version: 25.1.2
Avatar

Hello, I have this property grid and want to localize the displayed header (DisplayName) using Binding but it is not possible because it is not a DependencyProperty. Then how can I achieve this header in the property grid to be localized/translated in similar way like in my user controls below?

                <grids:CategoryEditor Category="General inputs" DisplayName="General inputs">
                    <grids:CategoryEditor.Properties>
                        <grids:CategoryEditorProperty PropertyName="Name" />
                        <grids:CategoryEditorProperty PropertyName="Label" />
                    </grids:CategoryEditor.Properties>
                    <grids:CategoryEditor.EditorTemplate>
                        <DataTemplate>
                            <Grid Grid.IsSharedSizeScope="True">
                                <ItemsControl>
                                    <propertyGrid:GridTextBox Label="{translation:Translate PatternName}" PropertyPath="{Binding Children[Name].Name}" SelectedValue="{Binding Children[Name].Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True"/>
                                    <propertyGrid:GridTextBox Label="{translation:Translate PatternLabel}" PropertyPath="{Binding Children[Label].Name}" SelectedValue="{Binding Children[Label].Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                </ItemsControl>
                            </Grid>
                        </DataTemplate>
                    </grids:CategoryEditor.EditorTemplate>
                </grids:CategoryEditor>

Thanks for the answer!

Comments (1)

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

Hello,

Some of those classes are plain CLR objects and are not controls or dependency objects themselves.  Therefore, as you saw, they don't have dependency properties.

There are several options to localize this:

1) Create the CategoryEditor totally in code-behind, using localized strings for those properties.

2) Keep the CategoryEditor in XAML, but set those string properties in code-behind, using localized strings.

3) Create or use a third-party markup extension that can pull in the resources and apply that in XAML.  While we haven't tried it ourselves, here is one possible library option for a markup extension.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.