Note that there are some explanatory texts on larger screens.

plurals
  1. POXaml ScrollViewer scrollbars are not shown
    text
    copied!<p>I have a UserControl which contains a ScrollViewer.</p> <pre><code>&lt;UserControl&gt; &lt;ScrollViewer Name="ScrollContainerScroller" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"&gt; &lt;ListBox Name="MyItemsListBox" ItemsSource="{Binding MyItems}"/&gt; &lt;/ScrollViewer&gt; &lt;/UserControl&gt; </code></pre> <p>When consuming this UserControl inside a stackpanel the ScrollViewer's scrollbars are not shown.</p> <pre><code>&lt;Border&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;!-- top --&gt; &lt;RowDefinition Height="*"/&gt; &lt;!-- content --&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;!-- bottom --&gt; &lt;/Grid.RowDefinitions&gt; &lt;StackPanel Grid.Row="1" VerticalAlignment="Top"&gt; &lt;Grid Name="ContentButtons" Height="20"&gt; &lt;Button Name="MinimizeContent"/&gt; &lt;Button Name="MaximizeContent"/&gt; &lt;/Grid&gt; &lt;ContentControl Name="MyContent"/&gt; &lt;/StackPanel&gt; &lt;!-- &lt;ContentControl Name="MyContent" Grid.Row="1" VerticalAlignment="Top"/&gt; --&gt; &lt;Grid Name="MyBottomControls" Grid.Row="2" VerticalAlignment="Bottom"&gt; &lt;Button Name="Delete" HorizontalAlignment="Left" Style="{StaticResource DeleteButtonStyle}"/&gt; &lt;Button Name="Close" HorizontalAlignment="Center" Style="{StaticResource CloseButtonStyle}"/&gt; &lt;Button Name="Hide" HorizontalAlignment="Right" Style="{StaticResource HideButtonStyle}"/&gt; &lt;/Grid&gt; &lt;!-- shows up at last so the Grid can place it at the very top it in the Z axis --&gt; &lt;ContentControl Name="MyTop" Grid.Row="0" VerticalAlignment="Top"/&gt; &lt;/Grid&gt; &lt;/Border&gt; </code></pre> <p>When I remove the wrapping stackpanel the scrollviewer is shown correctly.</p> <p>What do I have to do for making the scrollbars also work with the additional stackpanel which wraps the MyContent-contentcontrol?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload