Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have a created a Usercontrol similar to this earlier. This sample code may provide you a good starting point.</p> <pre><code>&lt;Border BorderThickness="2" BorderBrush="Black"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="20"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="20"&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;RepeatButton Grid.Row="0" x:Name="btnUp" Focusable="False" Command="ScrollBar.LineUpCommand" CommandTarget="{Binding ElementName=firstItem}" BorderBrush="Transparent"&gt; &lt;RepeatButton.Background&gt; &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"&gt; &lt;GradientStop Color="White" Offset="0"&gt;&lt;/GradientStop&gt; &lt;GradientStop Color="Black" Offset=".5"&gt;&lt;/GradientStop&gt; &lt;/LinearGradientBrush&gt; &lt;/RepeatButton.Background&gt; &lt;RepeatButton.Content&gt; &lt;Path Fill="White" Data="M 0 10 L 36 10 L 18 0 Z"/&gt; &lt;/RepeatButton.Content&gt; &lt;/RepeatButton&gt; &lt;ListView Grid.Row="1" FontSize="22" Foreground="White" ScrollViewer.VerticalScrollBarVisibility="Hidden" HorizontalContentAlignment="Center" Background="Black" &gt; &lt;ListView.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;StackPanel MaxWidth="500"/&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ListView.ItemsPanel&gt; &lt;ListViewItem Name="firstItem"&gt;A&lt;/ListViewItem&gt; &lt;ListViewItem&gt;B&lt;/ListViewItem&gt; &lt;ListViewItem&gt;C&lt;/ListViewItem&gt; &lt;ListViewItem&gt;D&lt;/ListViewItem&gt; &lt;ListViewItem&gt;E&lt;/ListViewItem&gt; &lt;ListViewItem&gt;F&lt;/ListViewItem&gt; &lt;ListViewItem&gt;G&lt;/ListViewItem&gt; &lt;ListViewItem&gt;H&lt;/ListViewItem&gt; &lt;ListViewItem&gt;I&lt;/ListViewItem&gt; &lt;ListViewItem&gt;J&lt;/ListViewItem&gt; &lt;ListViewItem&gt;K&lt;/ListViewItem&gt; &lt;ListViewItem&gt;L&lt;/ListViewItem&gt; &lt;ListViewItem&gt;M&lt;/ListViewItem&gt; &lt;ListViewItem&gt;N&lt;/ListViewItem&gt; &lt;ListViewItem&gt;O&lt;/ListViewItem&gt; &lt;/ListView&gt; &lt;RepeatButton Grid.Row="2" x:Name="btnDown" Focusable="False" Command="ScrollBar.LineDownCommand" CommandTarget="{Binding ElementName=firstItem}" BorderBrush="Transparent"&gt; &lt;RepeatButton.Background&gt; &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"&gt; &lt;GradientStop Color="White" Offset="0"&gt;&lt;/GradientStop&gt; &lt;GradientStop Color="Black" Offset="0.5"&gt;&lt;/GradientStop&gt; &lt;/LinearGradientBrush&gt; &lt;/RepeatButton.Background&gt; &lt;RepeatButton.Content&gt; &lt;Path Fill="White" Data="M 0 0 L 18 10 L 36 0 Z"/&gt; &lt;/RepeatButton.Content&gt; &lt;/RepeatButton&gt; &lt;/Grid&gt; &lt;/Border&gt; </code></pre>
 

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