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
160
Can I set different title for content pane when docked and floating
posted

Can I set different title for content pane when docked and floating?

Example: When docked state, the title is "Docked", and when move to floating, the title is "Floating"

Parents
  • 2680
    Verified Answer
    Offline posted

    Hello,

    I have been looking into your question and created a small sample with a XamDockManager and a ContentPane whose header changes based on the pane being docked or floating.

    To achieve this, I added a style targeting the ContentPane to the XamDockManager’s resources. The style first sets the default header, which is “Docked” as the ContentPane is initially docked on application startup. Then the ”Floating” header is set, with the help of data triggers monitoring the PaneLocation property of the ContentPane. The PaneLocation changes upon docking and floating and its value is “FloatingOnly” when the pane is initially floated and “Floating” after right mouse click on the pane title bar -> Select “Dockable”.

    <Style TargetType="{x:Type igDock:ContentPane}" x:Key="changedLocationStyle">
                        <Setter Property="Header" Value="Docked"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource self}, Path=PaneLocation}" Value="Floating">
                                <Setter Property="Header" Value="Floating"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource self}, Path=PaneLocation}" Value="FloatingOnly">
                                <Setter Property="Header" Value="Floating"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>

    You can find the sample attached below. Please test it on your side and let me know if I may be of any further assistance.

    Sincerely,

    Bozhidara Pachilova

    Associate Software Developer

    8877.XDMChangeFloatingPaneHeader.zip

Reply Children