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
1655
how to change background color of split pane?
posted

how  to change the background color of the split pane?

And also how to give margin to content panes in a split pane?

And how to add image to the content pane?

I tried giving margin,Foreground, width in content pane, but it is not setting any properties. please see the code below.

 

 

 

 

 

<igDock:ContentPane x:Name="cpAS" Margin="10" Header="Search" Image="{Binding Path=AdvancedSearch}" Foreground="#662046" Width="200" IsPinned="False" AllowClose="False"></igDock:ContentPane>

 

Parents
No Data
Reply
  • 54937
    Offline posted

    Ritesh_2009 said:
    how  to change the background color of the split pane?

    The SplitPane is a FrameworkElement used to arrange is children. It does not currently provide a Background property (few FrameworkElements do). If you feel it should have one you may submit a suggestion for adding it. Note, the SplitPane never moves so as a ContentPane is moved elsewhere (or as in your snippet is Unpinned) then a background for the SplitPane would have no effect on the pane as it wouldn't be contained within that splitpane.

    Ritesh_2009 said:
    And also how to give margin to content panes in a split pane?

    Setting the Margin property (defined on the FrameworkElement class) is the way to control the space outside the ContentPane (i.e. the space between the ContentPane and its parent element). In your snippet you have 10 pixels of Margin on the top/left/right/bottom so when its unpinned (as it is in your sample) there will be 10 pixels all around the ContentPane between it and the containing elements of the UnpinnedTabFlyout. When it is pinned there will be 10 pixels between it and the containing SplitPane. If you want space around the content then you may set the Padding property.

    Ritesh_2009 said:
    And how to add image to the content pane?

    How you were doing it in the previous post you had where you were getting an error is the means by which you would. As I indicated in my reply to that post, the error you are getting means the path is incorrect or you do not have the image marked as a Resource build action in VS' properties for that file. Note by default the Image is only used within the associated tab item  (i.e. when within a TabGroupPane or unpinned) and within the pane navigator (the window shown when you press Ctrl-Tab or Alt-F7). If you want the image to be used elsewhere (e.g. within the PaneHeaderPresenter) then you would need to retemplate that element and determine how/where to position the Image element.

    Ritesh_2009 said:
    I tried giving margin,Foreground, width in content pane, but it is not setting any properties. please see the code below.

    That snippet works for me. Note, you should not set the Width or Height of a ContentPane. In WPF when you set the Width/Height of an element it will always be that extent regardless of what the containing element tries to arrange it as. You need to let the containing elements dictate the extent. For a root SplitPane docked to the Left/Right, you may set the Width property to control the initial extent of the split and therefore its children. For a root SplitPane docked to the Top/Bottom you may set the Height property. For a floating root SplitPane you may set the xamDockManager's attached FloatingSize property. To control the extent of the children within a SplitPane you should use the SplitPane's attached RelativeSize property. This property is used to calculate the percentage of the available space that each pane should receive.

Children
No Data