Hi,
I want to have only a flyout pane. The main content I don't want to have a close button, the "other tabs" button or to be movable at all. I could do this in Windows Forms using the DockManager from infragistcs there.
I would just create my window however I wanted, added a DockManager, then added a panel. I right clicked on it chose Dock Controls, then set the properites accordingly so that it functioned like the unpinned Solution Explorer.
How can I replicate the same UI with the XamDockManager?
Thanks
Andy
It would basically be the same thing. The xamDockManager is a ContentControl. That Content could be anything - the content doesn't have to be a DocumentContentHost (which is what would provide the VS like tabbed document interface). ContentPane is analogous to the UDM's DockableControlPane and has numerous settings (AllowDocking, AllowFloatingOnly, etc.) that determine how the end user may adjust the layout for that pane. The IsPinned property determines whether it is pinned. So a simplistic layout with a central Grid as the content and a set of unpinned panes would look like:
Ahh, ok that's what I was missing. I didn't realize the content didnt' have to be panes. That works exactly how I wanted it to, thanks!
Is there a way to make the "close" and "window position" buttons of the content panes to be invisible?
I can disable them through properties but they are always present. Also, can I make the header of the top dock pane invisible all together? I am trying to have a tool bar docked to the top of the UserControl, with pinned panes docked on the right and left, but I don't want to display the unnecessary buttons, or show the header at all for the tool bar docked at top as it will never move or be unpinned. Thanks for any help
shanewill said: Is there a way to make the "close" and "window position" buttons of the content panes to be invisible?
shanewill said:Also, can I make the header of the top dock pane invisible all together? I am trying to have a tool bar docked to the top of the UserControl, with pinned panes docked on the right and left, but I don't want to display the unnecessary buttons, or show the header at all for the tool bar docked at top as it will never move or be unpinned.
Thanks for the repspone. I tried using a template to accomplish this but came up with the error:
"Cannot create object of type 'Infragistics.Windows.Commands.IGRoutedCommand'. CreateInstance failed, which can be caused by not having a public default constructor for 'Infragistics.Windows.Commands.IGRoutedCommand'. Error at object 'System.Windows.Controls.Button', Line 1 Position 702."
In the designer.
The template I used is down below. The only thing I changed for this test was I set the ContentPaneTemplate1 to use the PaneHeaderTemplate1 and set PaneHeaderTemplate1's closeBtn Visiblity="Hidden".
I got this template by using blend. I started a new project, added a ContentHeader to the form, and then edited a copy of its Template. This may be incorrect, but that is how I came up with the Template I'm using down below.
One of the ContentPanes below uses ContentPaneTemplate1 as its template. This ContentPane now looses its images for its pinBtn and positionMenu. They still exist, but all visual aspects to them have been lost. Any suggestions on where I went wrong?
The template I used was:
<Window x:Class="InfragisticsWPFTests.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="574" Width="539" xmlns:igWindows="http://infragistics.com/Windows" xmlns:igDock="http://infragistics.com/DockManager" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration">
<Window.Resources>
<ControlTemplate x:Key="ContentPaneControlTemplate1" TargetType="{x:Type igDock:ContentPane}">
<AdornerDecorator>
<Border SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<DockPanel Margin="{TemplateBinding Padding}">
<igDock:PaneHeaderPresenter Visibility="{TemplateBinding HeaderVisibility}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Template="{DynamicResource PaneHeaderPresenterControlTemplate1}" DockPanel.Dock="Top"/>
<ContentPresenter Visibility="{TemplateBinding ContentVisibility}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</DockPanel>
</Border>
</AdornerDecorator>
</ControlTemplate>
<ControlTemplate x:Key="PaneHeaderPresenterControlTemplate1" TargetType="{x:Type igDock:PaneHeaderPresenter}">
<Grid>
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Button x:Name="closeBtn" Visibility="Hidden" Style="{DynamicResource PaneHeaderPresenter.CloseButtonStyleKey}" Command="igDock:ContentPaneCommands.Close" CommandParameter="{TemplateBinding Pane}" DockPanel.Dock="Right"/>
<Button x:Name="unpinBtn" Style="{DynamicResource PaneHeaderPresenter.PinButtonStyleKey}" Command="igDock:ContentPaneCommands.TogglePinnedState" CommandParameter="{TemplateBinding Pane}" DockPanel.Dock="Right"/>
<Menu x:Name="positionMenu" VerticalAlignment="Top" DockPanel.Dock="Right">
<Menu.Style>
<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="#00FFFFFF"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<igWindows:CardPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
</Menu.Style>
<MenuItem x:Name="PART_PositionMenuItem" Style="{DynamicResource PaneHeaderPresenter.PositionMenuItemStyleKey}"/>
</Menu>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
<Border x:Name="innerBorderHighlight" BorderBrush="{DynamicResource DockManagerBrushKeys.PaneNotActiveCaptionInnerBorderFillKey}" BorderThickness="1,1,1,0"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=Pane.IsActivePane, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="{DynamicResource DockManagerBrushKeys.PaneActiveCaptionFillKey}"/>
<Setter Property="Foreground" Value="{DynamicResource DockManagerBrushKeys.PaneHeaderActiveTextFillKey}"/>
<Setter Property="BorderBrush" TargetName="innerBorderHighlight" Value="{DynamicResource DockManagerBrushKeys.PaneActiveCaptionInnerBorderFillKey}"/>
</DataTrigger>
</ControlTemplate.Triggers>
</Window.Resources>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<igDock:XamDockManager Height="Auto" Name="xamDockManager1" VerticalAlignment="Stretch" PaneNavigatorButtonDisplayMode="Never">
<igDock:XamDockManager.Panes>
<igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop">
<igDock:ContentPane Name="toolBarContentPane" AllowClose="False" AllowDocking="False" AllowDockingInTabGroup="False" AllowFloatingOnly="False" AllowInDocumentHost="False" AllowPinning="False" Template="{DynamicResource ContentPaneControlTemplate1}">
<my:WindowsFormsHost Height="Auto" Name="windowsFormsHost1" Width="Auto" HorizontalAlignment="Stretch" />
</igDock:ContentPane>
</igDock:SplitPane>
<igDock:SplitPane>
<igDock:ContentPane Name="seriesContentPane" AllowClose="False" AllowDocking="False" AllowDockingInTabGroup="False" AllowFloatingOnly="False" AllowInDocumentHost="False" />
<igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedRight">
<igDock:ContentPane Name="measureAndDimensionsContentPane" AllowClose="False" AllowDocking="False" AllowDockingInTabGroup="False" AllowFloatingOnly="False" AllowInDocumentHost="False"/>
</igDock:XamDockManager.Panes>
</igDock:XamDockManager>
</Window>
Blend's "Edit a Copy" functionality has many bugs/limitations so you really should use the xaml we shipped with the product - this is actually the primary reason we include it. For example you'll see that blend output "Command="igDock:ContentPaneCommands.Close"" but it should have been something like "Command="{x:Static igDock:ContentPaneCommands.Close}"". I'm sure there are other things in there as well -e.g. "Style="{DynamicResource PaneHeaderPresenter.CloseButtonStyleKey}" " should have been "Style="{DynamicResource igDock:PaneHeaderPresenter.CloseButtonStyleKey}"" (note the missing xml ns qualifier).
Ah, I just found the xaml that shipped with the product. Thanks,
Shane