Hello @ricaun,
I have tested you approach - sound like a reasonable solution.
So, firstly I have assigned a static trigger to my IExternalApplication, which switches between WPF-Window / DockablePane, depending on two conditions: 1. Is DockablePane already registered 2.Is at least one Document opened.
Then I play with Show() / Hide () methods. Logic-wise this works without any problems.
For that I am using one Page class (Singleton object), which is:
- on one hand registered as DockablePane
- on the other hand, serves as content for my WPF-Window
And this is where the problem appears. Problem is with UI display - no exceptions are thown during App Runtime. If I have only DockablePane registered (no instance of WPF-Window instance created) everything works. Simirarly, if I create a instance of my WPF-Window (no DockablePane registered) everything works as well. But if I show both at the same time, frame of both are visible, but no content, so no Page class instance (UI-wise).... Do you have any idea why this can be like this ?
Below my implementation
//ContentPage implemented as Singleton object
public partial class ContentPage : Page, INotifyPropertyChanged, IDockablePaneProvider
{
//Singleton implementation
public static ContentPage Instance
{
if (_instance == null)
_instance = new ContentPage();
return _instance;
}
}
DockablePane as already mentioned is registered OnApplicationInitialized (so far...)
uiControlledApp.RegisterDockablePane(dpid, "MyTitle", ContentPage.Instance as IDockablePaneProvider);
//WPF-Window also implemented as Singleton object
public partial class WPF_Window : Window
{
public static WPF_Window Instance
{
if (_instance == null)
_instance = new WPF_Window();
return _instance;
}
private WPF_Window()
{
InitializeComponent();
//XAML bounding to ContentPage Singleton instance
MainContent.Content = ContentPage.Instance;
}
}
//XAML content bounding to ContentPage:
<Window.Content>
<Frame x:Name="MainContent" NavigationUIVisibility="Hidden"/>
</Window.Content>
I don't think that it has anything to do with my Singleton objects.. I would rather see the problem in the BlackBox which is the Registering of DockablePane...
I would grately appreciate your feedback,
Best, Lukasz
PS. Yes, I am trying to built a sort of output window, which would damp everything that is happening in my IExternalApplication