Prism Integration with floating ToolWindow

Docking/MDI for WPF Forum

Posted 12 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Version: 12.1.0560
Avatar

Hi,

I'm using your Prism Integration and I need:

- a floating toolwindow

- when my application starts, this floating window must be hidden (but registered in my region)

- when we navigate to that window, the window is shown, floating and resized to its content

Best regards,

Comments (5)

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

Hi Stéphane,

If you look at our Prism sample, you can see that our ClassViewToolItemViewModel implements IDockingWindowInitializer.  You'd do something similar but in the Open method there, do nothing.  That will prevent the tool window from being displayed initially but it should be registered with the DockSite.

Eventually when you'd want to show it, you'd need to get the ToolWindow view for the view model and call this on it:

toolWindow.Float(FloatSizingBehavior.SizeToContent);


Actipro Software Support

Posted 12 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Avatar

Hi,

thank you for your reply.

Actually, in a MVVM way it was better not to know, that it is a floating ToolWindow, I was expecting to use this kind of code to show my view:

this.RegionManager.Regions[SRS.Infrastructure.RegionNames.MainRegion].RequestNavigate(ViewNames.FindAndReplaceView);

 So in this part of the code, I don't know that it is a ToolWindow and I don't want to write specific code to get a floating ToolWindow.

My idea was to specify that I want a floating window only at the initialization like this:

<prism:ToolWindowInitializer.Initializer>
        <prism:ToolWindowInitializer Name="FindAndReplace" 
                                     Title="Find and replace" 
                                     ImageSource="{StaticResource ImgFindHS}"
                                     IsInitiallyFloating="True"
                                     Height="Auto" />
    </prism:ToolWindowInitializer.Initializer>

In the layout I want to avoid this:

<ToolWindow UniqueId="dd591dcb-fafd-4aea-8f93-02c7fb592461" AutoHideSize="272,292" DockedSize="200,705" DocumentSize="272,292" FloatingSize="272,292" Size="200,705" IsOpen="false" LastState="Docked" Name="FindAndReplace" RaftingLocation="785,317" State="Floating" />

 The ToolWindow should be hidden when the application is started.

What do you suggest ? Is it possible ?

[Modified 12 years ago]

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

Hi Stéphane,

We don't have initial rafting functionality or code to not open the window if its initialized currently in the add-on.  I can write down those feature requests.  In the meantime, our full source for the Prism add-on is in our codeplex site and you can modify it as needed for your needs to support your desired functionality.


Actipro Software Support

Posted 12 years ago by BLANC Stéphane - Staubli Robotics Suite Product Manager, STAUBLI
Avatar

Hi,

that what I did, it works fine except for the serialization.

I want a floating ToolWindow, initially hidden even after loading a layout.

I don't want to save the state of this floating window.

My problem is that the layout serializer saves its state, and when I load the layout, the window is visible, how is it possible to modify the serialization for this kind of ToolWindow ?

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

Hi Stéphane,

You could either close the tool window right after the layout load (but that will have a flicker), or perhaps better would be to close it before you save your layout file.  That way in the layout, it should tell it not to open when you load the layout later on.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.