xaml - WPF what determines whether scrollviewer and stackpanel give infinite size to a child as opposed to a set size? -


during measure, i'm still confused because results in stackpanel's child (signalgraph) being given (292,infinity) availablesize in measure:

<window x:class="paneltesting.window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:wpfexp="clr-namespace:wpfexperimental"       title="window1" height="300" width="300">      <stackpanel     >       <wpfexp:signalgraph/>   </stackpanel> </window> 

while canvas of set size child given (infinity, infinity) available size. assume has interaction window, i'm confused going on.

<canvas width="100" height="100">     <stackpanel sizechanged="scrollviewer_sizechanged"     >       <wpfexp:signalgraph/>     </stackpanel> </canvas> 

the same thing occurs when scrollviewer used. wanted able understand how scrollviewer gives sizes children. wondering if changing panels in controltemplate might result in scrollviewer passes scrollviewer size availablesize child instead of infinite space.

i've coded work around, want understand this, i'm there wasn't easier way behavior wanted.

stackpanel measures children infinity in direction of orientation, infinite height when orientation vertical; other orientation given constraint got.

canvas measures children infinite width , height.

for scrollviewer, if content implements iscrollinfo (i.e. provides scrolling functionality) , cancontentscroll true child measured based on constraint given, possibly minus amount needed scrollbar(s) if shown. of course responsible handling scrolling.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -