Hey,
I have a win forms app that uses an mdi parent form. It's not the same feel as something like Word or as something like visual studio. It's a bunch of varying forms that float inside of the parent.
To convert this to wpf I was thinking I could just convert each form over as a wpf user control. Each menu option could create the corresponding user control, put it in a content pane, then add it to the XamDockManager as a "document". The user could then use the tabs to navigate through the different screens or could move/dock/float them around to arrange them.
Is this approach sound like a valid use of the XamDockManager? I want to have my screens in one "shell", but I also want it to be intuitive to the user. The docking/sizing piece feels awkward (do the user controls stay centered or resize to fill the visible region?). Also, hitting ctrl-tab within the dock manager and seeing a screen listed as a "file" feels awkward.
Any guidance would be greatly appreciated.
Thanks
jlotridge said: Is this approach sound like a valid use of the XamDockManager?
The DocumentContentHost is designed to provide a tabbed document interface similar to that of VS so if that tabbed document model fits your needs then it seems fine.
jlotridge said:The docking/sizing piece feels awkward (do the user controls stay centered or resize to fill the visible region?).
I'm not sure what you mean by awkward. The docking/sizing follows the behavior of VS. With regards to where/how the content of the ContentPane is positioned/arranged that is really up to you. By default the (Horizontal|Vertical)ContentAlignment is set to stretch so the content will be stretched to fill the content pane. You can change that based on your needs. As to what happens to the contents of whatever you put into the ContentPane (e.g. your usercontrol) again that is really up to you and the content within each. You would use whatever panels/etc. you would want to arrange the contents.
jlotridge said:Also, hitting ctrl-tab within the dock manager and seeing a screen listed as a "file" feels awkward.
The application that I want to convert doesn't really have "documents". It's really just a bunch of data entry screens and reports. I guess more or less I was fishing to see if the dock manager makes sense to be used with data entry screens, or if there is a specific way that it can be used to best suit data entry screens, or if Infragistics has any other wpf controls that might help in this sort of situation.
When I mentioned the awkwardness of sizing in my original post, I was just thinking about how every screen is likely to be put into a content pane that is a different size than the size the screen was originally designed in. I guess that all screens would all have to be set up carefully so that resizing would work intuitively?
I can't really say whether XDM will work for your data entry screens; you need to determine whether the layout functionality provided by the xdm works for your layout requirements. As to any other product, I'm still unsure what functionality you would be expecting. If you think a new product is needed then I would recommend submitting a suggestion with as much detail as possible about the specific requirements/functionality so it can be considered for a future version of the product. If you think that adding mdi window type layout to xdm would be helpful then you could also submit a suggestion for that but in the most basic usage, maximizing an mdi child is similar to having one document tab group since you just see the contents of a single "window".
Thank you for your responses.
I think that I will be able to use the XDM as-is -- I just wanted to make sure that using it in this way wasn't blatently incorrect.
One more question:
Is there a programmatic way to create and add a floating only content pane to the dock manager?
Right now I'm adding it to my default tab group pane then calling ContentPaneCommands.ChangeToFloatingOnly on it -- but I'm having some problems with it and I'm not even sure that it's the right way to do it.
I want my user control to fit perfectly within the content pane with its initial dimensions when it is first shown, but then to resize with the content pane.
No they shouldn't try to keep focus. I would recommend putting together a sample that demonstrates the issue and submit it to the support group - http://es.infragistics.com/gethelp/default.aspx#Overview.
One more question related to floating panes: do they try to keep focus? Sometimes when I make a new one I'm not longer able to click on my shell window (the window that my dock manager is located on). Clicking on the window just results in different floating windows activating. It eventually lets me click my shell window again after some resizing/moving of the floating windows. Is there some sort of intended behavior that results in this or should I always be able to click on my shell window when there are floating content panes?
Oops! I meant to post this is my other thread (http://forums.infragistics.com/forums/t/10258.aspx), sorry.
I was adding it to my default tab group pane because I was trying to figure out a way to use the ChangeToFloatingOnly command -- I was just digging around regular properties/methods and didn't think to use XamDockManager.InitialLocationProperty. Using a split pane with its initial location set to floating only works perfectly -- thanks for the help.
Are you adding it to the "default tab group pane" because you want it to be there should the user change its state back to dockable/document (depending on where it is)? If you just want to put a contentpane into a floating only container then you can just create a SplitPane, set its InitialLocation to FloatingOnly, add the ContentPane to the SplitPane and add that SplitPane to the XDM's Panes collection. If you need to add it to the default tab group pane first then what you could do is to handle the ToolWindowLoaded and while executing the ChangeToFloatingOnly command, clear the attached XamDockManager.FloatingSize of the PaneToolWindow's Pane when the event is raised.