Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change AvalonDock's properties without restart application #384

Closed
LHTXQ opened this issue Oct 8, 2022 · 2 comments
Closed

Cannot change AvalonDock's properties without restart application #384

LHTXQ opened this issue Oct 8, 2022 · 2 comments

Comments

@LHTXQ
Copy link

LHTXQ commented Oct 8, 2022

version: 4.70.2 - .net 6 - win10

xaml:

                    <LayoutAnchorablePaneGroup Orientation="Vertical" DockHeight="*" DockWidth="200" DockMinWidth="30" DockMinHeight="30">
                        <LayoutAnchorablePane Name="ModulePage1stLayoutAnchorablePane" DockHeight="*" DockWidth="*" DockMinHeight="30" DockMinWidth="30">
                            <LayoutAnchorable ContentId="1" Title="{DynamicResource Module}" CanDockAsTabbedDocument="False" CanHide="False"/>
                            <LayoutAnchorable ContentId="2" Title="{Binding CurrentLanguage}" CanDockAsTabbedDocument="False" CanHide="False"/>
                        </LayoutAnchorablePane>
                        <LayoutAnchorablePane Name="ModulePage2ndLayoutAnchorablePane" DockHeight="175" DockWidth="*" DockMinHeight="30" DockMinWidth="30">
                            <LayoutAnchorable ContentId="3" Title="{DynamicResource About}" CanDockAsTabbedDocument="False" CanHide="False"/>
                            <LayoutAnchorable ContentId="4" Title="4" CanDockAsTabbedDocument="False" CanHide="False"/>
                        </LayoutAnchorablePane>
                    </LayoutAnchorablePaneGroup>
                    <LayoutPanel Orientation="Vertical" DockHeight="*" DockWidth="*" DockMinWidth="30" DockMinHeight="30">
                        <LayoutDocumentPane DockHeight="*" DockWidth="*" DockMinHeight="30" DockMinWidth="30">
                            <LayoutDocument ContentId="5" Title="{DynamicResource Fonts}" CanClose="False">
                                <ui:Button Content="{DynamicResource Calculator}" Click="Button_Click"/>
                            </LayoutDocument>
                            <LayoutDocument ContentId="6" Title="5" CanClose="False"/>
                        </LayoutDocumentPane>

After changed the values of '{DynamicResource Module}' and '{Binding CurrentLanguage}', the contents in avalondock have not changed accordingly as other controls(eg: ui:Button). In addition, title property bound to '{Binding CurrentLanguage}' which was set to "Chinese" was displayed as empty.

Before:
image

After:
image


Besides, after changed cultureinfo, the menu language of AvalonDock also have not changed accordingly. It requires restart to change the menu language.

image

@LHTXQ
Copy link
Author

LHTXQ commented Oct 8, 2022

I'm not good at programing and couldn't find any helpful information on the Internet, please tell me how to change the properties without restart application. Thanks!

@Dirkster99
Copy link
Owner

The string output you are showing should be controlled by the user of AvalonDock if you follow the MVVM design pattern, so these strings you are showing should under your own control. Have a look at my sample application Edi to better understand how multiple languages can be supported with AvalonDock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants