wpf - How to force Grid to shrink an auto sized row that contains ScrollViewer (when needed)? -


I am new to WPF I want to make this simple layout and I can not do this I want to draw it for you:

how it should work < / P>

Always have a blue text right below the green element, but when there is not enough space, the green element should be placed inside a scroll container (visible with vertical scrollbar).

I tried stackpayel and grid and both failed stackpayels did not reduce all rows. The grid does the same, if the height of the top width is set to "Auto" (its scrollbar is not visible inside scroll bar). If it is set to a star, the blue text is transferred to at least half the space (depending on the height of the line setting below) the height of the lower line can be either an "auto" or a star That is set to the top of a blue with vertical alignment, but the height of the row should be kept at least as large as text. Of course the entire area (black box) can not be extended with its content - it is determined by the size of the window.

If you know how to work it properly, please help. If you want, then post it in XAM Thank you!

Inspired by Eric's perspective by putting a greedy container in another tight container, what I wanted was In order to obtain it is actually discovered in a simple way. I need only one container which first reduces a child, then (when first completely disappears) is another one and such a container is : The dock panel goes here:

  & lt; Dockpanel Last Childfill = "Wrong" & gt; & Lt; DockPanel DockPanel.Doc = "Top" & gt; & Lt; TextBlock DockPanel.Dock = "TextWatching" "Down" Grid. Line = "1" & gt; Text of unknown length wrapped automatically. & Lt; / TextBlock & gt; & Lt; ScrollViewer & gt; & Lt; TextBlock TextWrapping = "wrap" & gt; In this case, the element is too large to fit inside the blue space (black box) under the blue text. I want the scrollbar to be displayed instead of moving the blue text outside the black box (and the clip) & lt; / TextBlock & gt; & Lt; / ScrollViewer & gt; & Lt; / DockPanel & gt; & Lt; / DockPanel & gt;  

Simple as that! :) I hope this helps someone.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -