Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Add this style:</p> <pre><code>&lt;Style TargetType="ScrollViewer"&gt; &lt;Setter Property="VerticalScrollBarVisibility" Value="Auto"/&gt; &lt;Setter Property="HorizontalScrollBarVisibility" Value="Auto"/&gt; &lt;Setter Property="Background" Value="Transparent"/&gt; &lt;Setter Property="Padding" Value="0"/&gt; &lt;Setter Property="BorderThickness" Value="0"/&gt; &lt;Setter Property="BorderBrush" Value="Transparent"/&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="ScrollViewer"&gt; &lt;Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="ScrollStates"&gt; &lt;VisualStateGroup.Transitions&gt; &lt;VisualTransition GeneratedDuration="00:00:00.5"/&gt; &lt;/VisualStateGroup.Transitions&gt; &lt;VisualState x:Name="Scrolling"&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/&gt; &lt;DoubleAnimation Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="NotScrolling"&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;Grid Margin="{TemplateBinding Padding}"&gt; &lt;ScrollContentPresenter x:Name="ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/&gt; &lt;ScrollBar x:Name="VerticalScrollBar" IsHitTestVisible="False" Height="Auto" Width="5" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" /&gt; &lt;ScrollBar x:Name="HorizontalScrollBar" IsHitTestVisible="False" Width="Auto" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" /&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>And use this code to detect when <code>ListBox</code> completes scroll:</p> <pre><code>var ScrollingState = FindListBoxStateGroup(listBox, "ScrollStates"); if (ScrollingState != null) { ScrollingState.CurrentStateChanging += (sender, args) =&gt; { if (args.NewState.Name.Equals("NotScrolling")) { } } } public static VisualStateGroup FindVisualState(FrameworkElement element, string name) { if (element == null) return null; IList groups = VisualStateManager.GetVisualStateGroups(element); foreach (VisualStateGroup group in groups) if (group.Name == name) return group; return null; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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