xaml - prevent WPF clipping of Grid content when translated vertically -


i have following xaml displays stack panel of text blocks. because of main grid size, last few items in stack panel naturally clipped. if translate stack panel's parent grid (not main grid) vertically up, stack panel's contents still clipped instead of displaying items @ bottom. how can perform vertical translation on grid without clipping bottom contents of stack panel?

the viewbox important - first grid needs size max height of main window or monitor.

<window x:class="wpfapplication5.mainwindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         title="mainwindow">     <viewbox>         <grid width="500" height="888" background="#cccccc">             <grid background="#cc99cc">                 <grid.rendertransform>                     <translatetransform y="-800"/>                 </grid.rendertransform>                 <stackpanel>                     <textblock text="this test 1" fontsize="50" foreground="blue"/>                     <textblock text="this test 2" fontsize="50" foreground="red"/>                     <textblock text="this test 3" fontsize="50" foreground="green"/>                     <textblock text="this test 4" fontsize="50" foreground="orange"/>                     <textblock text="this test 5" fontsize="50" foreground="yellow"/>                     <textblock text="this test 6" fontsize="50" foreground="purple"/>                     <textblock text="this test 7" fontsize="50" foreground="blue"/>                     <textblock text="this test 8" fontsize="50" foreground="red"/>                     <textblock text="this test 9" fontsize="50" foreground="green"/>                     <textblock text="this test 10" fontsize="50" foreground="orange"/>                     <textblock text="this test 11" fontsize="50" foreground="yellow"/>                     <textblock text="this test 12" fontsize="50" foreground="purple"/>                     <textblock text="this test 13" fontsize="50" foreground="blue"/>                     <textblock text="this test 14" fontsize="50" foreground="red"/>                     <textblock text="this test 15" fontsize="50" foreground="green"/>                     <textblock text="this test 16" fontsize="50" foreground="orange"/>                 </stackpanel>             </grid>         </grid>     </viewbox> </window> 

just take out height property on grid.

<window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         x:name="wind1"         title="mainwindow">     <viewbox>         <grid width="500" background="#cccccc">             <grid background="#cc99cc">                 <grid.rendertransform>                     <translatetransform y="-800"/>                 </grid.rendertransform>                 <stackpanel x:name="stack1">                     <textblock text="this test 1" fontsize="50" foreground="blue"/>                     <textblock text="this test 2" fontsize="50" foreground="red"/>                     <textblock text="this test 3" fontsize="50" foreground="green"/>                     <textblock text="this test 4" fontsize="50" foreground="orange"/>                     <textblock text="this test 5" fontsize="50" foreground="yellow"/>                     <textblock text="this test 6" fontsize="50" foreground="purple"/>                     <textblock text="this test 7" fontsize="50" foreground="blue"/>                     <textblock text="this test 8" fontsize="50" foreground="red"/>                     <textblock text="this test 9" fontsize="50" foreground="green"/>                     <textblock text="this test 10" fontsize="50" foreground="orange"/>                     <textblock text="this test 11" fontsize="50" foreground="yellow"/>                     <textblock text="this test 12" fontsize="50" foreground="purple"/>                     <textblock text="this test 13" fontsize="50" foreground="blue"/>                     <textblock text="this test 14" fontsize="50" foreground="red"/>                     <textblock text="this test 15" fontsize="50" foreground="green"/>                     <textblock text="this test 16" fontsize="50" foreground="orange"/>                 </stackpanel>             </grid>         </grid>     </viewbox> </window> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -