Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Display correct header when pane floated
posted

Hi there,

My ContentPane.Header is set to a <Grid> with a custom set of visuals. However, when the window is floated, the default Windows XP non-client area is displayed with the X (close) button and "System.Windows.Controls.Grid" as the title, which is confusing to the user.

Is there a property to set to ensure the same visual header is displayed in Floating mode as in the Docked mode.

If not, are there any examples on how to restyle a PaneToolWindow?

I've tried setting the value of UseOSNonClientArea to false (e.g. via App.xaml)but it doesn't seem to work. The value is true if I float the window and check the property using Snoop.

<Application x:Class="WpfApplication1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:igDock="http://infragistics.com/DockManager" xmlns:Themes="clr-namespace:Infragistics.Windows.Themes;assembly=InfragisticsWPF4.v10.3" StartupUri="MainWindow.xaml">
    <Application.Resources>
        <Style TargetType="{x:Type igDock:PaneToolWindow}" BasedOn="{x:Static Themes:PrimitivesLunaNormal.ToolWindow}">
            <Setter Property="UseOSNonClientArea" Value="False" />
        </Style>
    </Application.Resources>
</Application>

 

Also, is it possible to apply a custom PaneToolWindow style to a particular pane but not the rest?

Thanks.

Parents
No Data
Reply
  • 54937
    Offline posted

    abryte said:

    Is there a property to set to ensure the same visual header is displayed in Floating mode as in the Docked mode.

    No, currently the behavior mimics that of VS 2008 and prior whether the floating window shows its own caption that displays the text of the pane if there is only 1 pane contained within and the pane's header is hidden. I believe this may get into an upcoming 11.1 service release.

     

    abryte said:

    If not, are there any examples on how to restyle a PaneToolWindow?

    I've tried setting the value of UseOSNonClientArea to false (e.g. via App.xaml)but it doesn't seem to work. The value is true if I float the window and check the property using Snoop.

     

    If you want to set the UseOSNonClientArea you would typically do that in the ToolWindowLoaded. If you have set the Theme of the xamDockManager then that theme will provide the local implicit style for the PaneToolWindow so you're app.resources style will have no effect.

    That being said even when UseOSNonClientArea is false, the Title of the PaneToolWindow (which is a string property matching the Title property of the WPF Window class that is typically used to host the PaneToolWindow) is displayed. In theory you can re-template the PaneToolWindow to not have a caption area and change the ContentPane's template so that the ContentPaneHeader within will always be displayed but there will likely be complications. First the xamDockManager won't be expecting the content pane's caption to be shown so if you start dragging it, it will likely move that into a new floating window thinking that it is pulling the pane out of a floating window that is grouped with other panes. Second, there are times where you need to have the PaneToolWindow display a caption. For example even in VS 2010, you will see a caption in the floating window other than the pane's caption if you have 2 panes docked together in a floating window positioned next to each other.

    abryte said:

    Also, is it possible to apply a custom PaneToolWindow style to a particular pane but not the rest?

     

    Note ContentPane's are not necessarily hosted by themselves in a floating window. Just as with VS you can group multiple panes together in a floating window. If you did want to style a specific PaneToolWindow (regardless of the panes that might be within) you would handle the ToolWindowLoaded and set the e.ToolWindow.Style.

Children
No Data