Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Property Binding DocumentContentHost
posted

Hello!

I have a XamDockManager with a DocumentContentHost. I've implemented a UserControl with some custom DependencyProperties. At runtime I add the UserControl in a ContentPane.

Now I got the problem if I switch the Tab Doc Page, all my custom Properties are reset to the inital default values (go to the next page and switch back).

It seems this is only the case in the main control (UserControl). All child controls keep the current state.

How can I prevent the property reset on pane activation?

thx benni

Parents
  • 54937
    Offline posted

    The ContentPane doesn't do anything with its Content other than to host it in a ContentPresenter in its template as any ContentControl derived element does. Since you mention that the problem only happens when switching tabs I can only guess that something is changing the state of your object in response to an Unloaded event as the TabGroupPane which hosts the tabs is a derived WPF TabControl and the WPF TabControl only keeps the content of the selected tab in the visual tree and therefore when you switch tabs the unloaded event is raised.  If this is not the issue and you are still experiencing this problem please provide a sample project and we can investigate what is the cause of the problem you are seeing.

Reply Children