Hi there,
I am using your DockHintsVisualizer I was wonder if I can load userControl Window or most probably Window.xaml file programmatically.
Thanks.
Regards,
SAJ
here's the Xaml code:
<dxb:BarManager Name="barClientArea" dxlc:DockLayoutControl.Dock="Client" Margin="0.5">
<dxd:DockLayoutManager x:Name="DemoDockContainer" Background="Transparent" >
<dxd:DockLayoutManager.FloatGroups>
<dxd:FloatGroup>
<dxd:LayoutPanel Caption="Panel 002" Background="#FFE2E9EF">
<TextBlock FontStyle="Italic" Text="Try to drag this panel over layout"/>
</dxd:LayoutPanel>
</dxd:FloatGroup>
</dxd:DockLayoutManager.FloatGroups>
<dxd:LayoutGroup Orientation="Vertical" >
<dxd:LayoutGroup Height="3*">
<dxd:LayoutPanel x:Name="Panel1" Caption="Panel1" Width="*" Background="#FFE2E9EF">
<TextBlock FontStyle="Italic" Text="All hints will be hidden here"/>
</dxd:LayoutPanel>
<dxd:LayoutPanel x:Name="Panel2" Caption="Panel2" Width="*" Background="#FFE2E9EF">
<TextBlock FontStyle="Italic" Text="All hints will be visible here"/>
</dxd:LayoutPanel>
<dxd:LayoutPanel x:Name="Panel3" Caption="Panel3" Width="*" Background="#FFE2E9EF">
<TextBlock FontStyle="Italic" Text="All hints will be disabled here"/>
</dxd:LayoutPanel>
</dxd:LayoutGroup>
<dxd:LayoutPanel x:Name="Panel4" Caption="Panel4" Width="*" Height="2*" Background="#FFE2E9EF">
<TextBlock FontStyle="Italic" Text="Some hints will be disabled and some hints will be hidden here"/>
</dxd:LayoutPanel>
</dxd:LayoutGroup>
</dxd:DockLayoutManager>
</dxb:BarManager>
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Saj,
Thank you for your question, but I'm afraid that your requirements are not clear for me. Could you please describe your task in greater detail? What behavior do you want to achieve and how do you wish to use DockLayoutManager?
We are looking forward to hearing from your.
Thanks,
Dmitry
Hi again,
Thanks for your reply, I am using your DockLayoutManager control which has Layoutgroup and and then LayoutPanel. (as )
I can dock out this Panel (pane it inside, move right or left as i want to which is great), what I wanted to know:
Is there a way to load another WINDOW or UserControl into that LayoutPanel programmatically based on button click event.
i.e. I have provided the xaml code before, and in there you can see "Panel1", Panel2 and so on… I want my Window to get loaded into that based on a click event.
Thanks.
Regards,
SAJ
Hi Saj,
Thank you for the clarification!
I suggest you review the How to load an external Window/UserControl into a DocumentPanel Code Central example that describes how this task can be accomplished. Please review it and let me know if you need any further assistance.
Thanks,
Dmitry
Hi Mate,
I did look into your provided link to add panel dynamically but that's not working throwing error i.e.
'Only LayoutGroup or UIElement can be used as content'
that example is for documentPanel where as, I want to load the window or userControl into LayoutPanel (not in docPanel)
I tried using ur given example like this:
layoutpanel1.Content = new Uri(@"UICommon\LoginWindow.xaml", UriKind.Relative); but got above mentioned error at runtime BUT when i used that in DocuPanel as follows, it works fine
[ docPanel1.Content = new Uri(@"UICommon\LoginWindow.xaml", UriKind.Relative); ]
But I need to use LayoutPanel in which i need to load the Window/user Control.
Thanks in Advance
Regards,
SAJ
Hi Saj,
The LayoutPanels class does not support assigning a URI as its content, but you can easily overcome this limitation if you'll assign controls directly. I've modified the sample project to demonstrate this approach. You can find it in the attachment. Please try this solution and provide us with feed back on whether it suits your needs.
Thanks,
Dmitry
Hi Dmitry,
Thanks for your reply I have sorted that out by creating layoutPanel object and adding UserControl into that, and then adding into its Group, I will look into your solution as well.
I got another question related to this, do you know when you close those panels inside DOCKLAYOUT, they still in there and when you right click it shows a context menu 'closed panels' when you click on it the top header appears (with the list of all the closed windows, u can click n select which window do you wish to active) i need to know the following:
- Is there a way to show that header all the time, which gives you the list of all the closed panels, and
- if I want to permanently close the panel (without it appearing in that top header) in other words just kill the panel as I don't want to work with that. how do I do that?
- and When I launch the new panel I want it to be appeared as Activated Panel(as it doesn't get focused until i click on it)
thanks in advance.
Regards,
SAJ
Hi again mate,
I am using your way to load window into panel (where as mine one is same as yours) when I load the window into the panel rather than UserControl it assigns that window on separate thread I guess, so when I am closing the Application some how that window is still running in TaskManager and as I try to recompile solution I get following error in visual Studio
"Error 5 Unable to copy file "obj\x86\Debug\UserInterface.exe" to "bin\Debug\UserInterface.exe". The process cannot access the file 'bin\Debug\UserInterface.exe' because it is being used by another process. UserInterface
"
So i have to manually go and kill that UserInterface.exe in TaskManager, then it compiles fine!!!
here is my code:
LayoutPanel panelWindow = new LayoutPanel { Content = new BasicDetails().Content }; //BasicDetails is the Window
layoutGroup1.Add(panelWindow);
ActivateItem(panelWindow); //to activate window
and also waiting on reply fro prev message I have sorted the Activate Window bit from prev question but another two part I can't figure out.
Thanks.
Regards,
SAJ
Hi Saj,
Thank you for the update.
>>So i have to manually go and kill that UserInterface.exe in TaskManager.
Yes, I see the described problem. I've missed a thing that if a new widow instance was created it is necessary to manually call its Close method to let it be destroyed. Thus, it is necessary to slightly modify the code:
Window window = new BasicDetails(); LayoutPanel panelWindow = new LayoutPanel { Content = window.Content }; window.Close();
>>- Is there a way to show that header all the time, which gives you the list of all the closed panels
Please set the DockLayoutManager's ClosedPanelsBarVisibility property to Auto.
>>- if I want to permanently close the panel (without it appearing in that top header) in other words just kill the panel as I don't want to work with that. how do I do that?
Utilize the panel's ClosingBehavior property to switch between Hiding and Removing modes.
I've modified the sample project accordingly to demonstrate you these solutions in action. Hopefully, you will find this information helpful.
Thanks,
Dmitry
I apologize for not attaching help topic links for my previous message. Please find them here:
ClosedPanelsBarVisibility property.
ClosingBehavior property.
Thanks,
Dmitry
hi mate,
many thanks for your prompt replies n very helpful as well, I havent been able to figure out the close property as when the panels are opened, they got two properties/actions either you can pane it or hide it by pressing 'x' button or 'pin' icon, and then they appears in the ClosedPanelsBarVisibility.
- is there possibility to have another CLOSE button or something which could just remove the panel from the Dock rather than hiding it in a bar, i know there is a way to find the panel from DockLayoutManager and then remove it, but where Do I specify that action as I need a button or something in that ClosedPanelsBarVisibility
- Can we add extra button like Minimize in the Panel just like that close n pane button.
- and also when you right click that ClosedPanelsBarVisibility bar (which appears within dockLayoutManager (carrying all the windows which has been closed n moved there) the right context menu shows CUSTOMIZE action, is it possible to remove that Customize option from that context menu (on right click) so user doesn't get confused.
Thanks.
Regards,
SAJ
Hi Sharjeel,
Thank you for your questions. I'll research the possibility of implementing the required features and get back to you once I have any results. Your patience is appreciated.
Thanks,
Dmitry
Hi Saj,
Thank you for your patience!
I've created a sample project to demonstrate how to add a custom button to the LayoutPanel header. You can find it in the attachment.
You will find the 'Remove panel' button within the PanelControlBoxControl's template. Its appearance is defined in the CustomButtonTemplate style and is similar to the appearance of standard buttons for Office 2007 Black theme. You can add a custom minimize button in a similar manner.
Please review the sample project and provide us with your feedback on whether it suits your needs.
>>is it possible to remove that Customize option from that context menu (on right click) so user doesn't get confused.
This is a BarManager feature. Please set its AllowCustomization property to "False" to get rid of this menu element.
Thanks,
Dmitry