Hello,
I have a ContentPane in a SplitPane that is docked to the bottom. It contains a single read-only RichTextBox that I intend to use for status messages.
When the height of all lines exceeds the visible space of the RichTextBox it resizes itself and with it the whole ContentPane.
This is clearly a bug or, if not, at least an unexpected behaviour, as the size of the Content panes should only depend on the user's setting (By dragging the splitter).
Is there a workaround for that?
Hello ,
Thank you for posting. The behavior you described is expected because what will happen when no extent is specified is that the element is measured with the available size. In the case of the richtextbox it’s going to try to take as much space as possible to display its content.
In that case the richTextBox essentially uses all the available width. Now in your case its doc to bottom, the xaml DockPanel that would be like this and as you type you will see that the richtextbox will get taller/smaller.
<DockPanel LastChildFill="False"> <RichTextBox Name="RichTextBox1" DockPanel.Dock="Bottom" /> </DockPanel>
The corollary in xamDockManager would be:
<igDock:XamDockManager Name="xamDockManager1"> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom"> <igDock:ContentPane Header="Pane 1" AllowDockingBottom="true" > <RichTextBox Name="RichTextBox1" /> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager>
If you wants to keep it a fixed size then you can set the Height on that root split pane.e.g.
<igDock:XamDockManager Name="xamDockManager1"> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom" Height="200"> <igDock:ContentPane Header="Pane 1" AllowDockingBottom="true" > <RichTextBox Name="RichTextBox1" /> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager>
Let me know if you have any question.
Thank you,Divya Jain
Never mind. I found a workaround:
<igDock:XamDockManager Name="xamDockManager1"> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom"> <igDock:ContentPane Header="Pane 1" AllowDockingBottom="true" > <Grid x:Name="Grid1"> <GridHeight="{Binding ElementName=Grid1, Path=ActualHeight}"> <RichTextBox Name="RichTextBox1" VerticalScrollBarVisibility="Auto"/> </Grid> </Grid> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager>
(Why is it next to impossible to edit this code?? The text cursor is not where the actual input is happening)