title: WPF Listbox with wider scrollbars
body: <p>I'm totally new on WPF and I need your help for creating a wpf custom ListBox with scrollbar wider than the default.</p>
  
  <p>I've found a solution that works fine for a Window WPF including a ListBox:</p>
  
  <pre><code>&lt;Window x:Class="iFixCustomControlsTest.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:cc="clr-namespace:iFixCustomControls;assembly=iFixCustomControls"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;ListBox HorizontalAlignment="Left" Height="92" Margin="56,88,0,0" VerticalAlignment="Top" Width="357" ScrollViewer.VerticalScrollBarVisibility="Visible"/&gt;
      &lt;/Grid&gt;
  
      &lt;Window.Resources&gt;
          &lt;Style TargetType="ScrollBar"&gt;
              &lt;Setter Property="Width" Value="100"/&gt;
          &lt;/Style&gt;        
      &lt;/Window.Resources&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>This solution is not the my favorite one, because it implies to write code in a Window including a "classic" Listbox. What I need is a way to modify scrollbar inside the Listbox (if I understood fine) in Generic.xaml:</p>
  
  <pre><code>&lt;ResourceDictionary
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:iFixCustomControls"&gt;
      &lt;Style TargetType="local:iFixCustomListBox" BasedOn="{StaticResource {x:Type ListBox}}"&gt;
          &lt;!--  
                Setting scrollbar wider than default
                Something like:
                &lt;Style TargetType="ScrollBar"&gt;
                    &lt;Setter Property="Width" Value="100"/&gt;
                &lt;/Style&gt;
          --&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>.cs file is:</p>
  
  <pre><code>public class iFixCustomListBox : ListBox
  {
      static iFixCustomListBox()
      {
          DefaultStyleKeyProperty.OverrideMetadata(typeof(iFixCustomListBox), new FrameworkPropertyMetadata(typeof(iFixCustomListBox)));
      }
  }
  </code></pre>
  
  <p>Is this approach correct  or a better way should involve User Control instead Custom Controls?</p>