Hi, I need your help.
Whie floating, the contentPane cannot show it's header normally after I custom it.
My Xaml code:
the DataTemplate:
<DataTemplate x:Key="paneHeader"> <Grid> <DockPanel> <TextBlock Text="{Binding PaneName}" VerticalAlignment="Center"/> </DockPanel> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,11,0"> <Image Source="Images/alarm01.png" Margin="5,0,0,0" Width="16" Height="16"/> <TextBlock x:Name="txt1" Text="{Binding Alarm1Count}" Margin="3"/> <Image Source="Images/alarm02.png" Margin="5,0,0,0" Width="16" Height="16"/> <TextBlock Name="txt2" Text="{Binding Alarm2Count}" Margin="3"/> <Image Source="Images/alarm03.png" Margin="5,0,0,0" Width="16" Height="16"/> <TextBlock Name="txt3" Text="{Binding Alarm3Count}" Margin="3"/> <Image Source="Images/alarm04.png" Margin="5,0,0,0" Width="16" Height="16"/> <TextBlock Name="txt4" Text="{Binding Alarm4Count}" Margin="3"/> </StackPanel> </Grid> </DataTemplate>
and Using:
<igDock:ContentPane Name="importantAlarmPane" HeaderTemplate="{StaticResource paneHeader}" >
and behind code:
importantAlarmPane.Header = new AlarmStatistics("New","1","2","3","4");
While floating, the header show:
WPF.Test.AlarmStatistics
What is wrong with me?
Wish your reply.
Thank you!
xu.jd
In addition, we recently added a new property to xamDockManager named FloatingWindowCaptionSource. Since the xamDockManager was designed to mimic VS 2008, which was the version of VS available at the time the component was developed, the floating windows by default have the header of the ContentPane collapsed when there is only 1 ContentPane in view. Instead the PaneToolWindow provides the caption area (by default letting the OS provide the non-client area caption but even when UseOsNonClientArea is set to false). The PaneToolWindow's Title is bound to the Header of that single pane. To maintain this existing behavior this new property defaults to UseToolWindowTitle.
When set to UseContentPaneCaption, the UseOSNonClientArea is forced/coerced to false (since complex content/elements cannot be rendered in the OS non-client area), the caption area of the PaneToolWindow is collapsed and the PaneHeaderPresenter of the ContentPane is allowed to be displayed which thereby allows the HeaderTemplate to be displayed.
Note regardless of this property when there are multiple ContentPane's in view (e.g. there are 2 ContentPanes in a floating window in a vertical/horizontal SplitPane) the caption area of the PaneToolWindow is displayed and contains a blank. This is the behavior displayed by VS 2010 and earlier.
Hello jdxu1984,
Thank you for your post. I have been looking through it and since there isn’t any built-in functionality I attached a sample project showing a custom approach. Basically there is a style for the PaneToolWindow, which is the element to which the ContentPane transforms after it becomes floating. This is why there should be a two separate styles for both elements using the same DataTemplate in order to look the same. Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.
Feel free to write me if you need further assistance.