title: WPF Listbox border on right side blurry
body: <p>I have a WPF application with a listbox showing some data. When i have the listbox in the center of the window and the window is an uneven width, on the right side the listbox is blurry. (Green is Rectangle, the blue part is a textbox)
  <a href="https://i.stack.imgur.com/P2OV8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P2OV8.png" alt="the (green) listbox has a blurry right side"></a>
  I tried to apply <code>SnapsToDevicePixels</code> virtually everywhere without result. (I know it should be inherited by child elements, but im almost pulling my hairs out)</p>
  
  <p>I could overcome this by having it set to <code>HorizontalAlignment="Left"</code> and have is always at a fixed size, but i know i'm just missing something, as the textbox does get rendered correct.</p>
  
  <p>Here is my (as clean as possible)code, showing the behavior:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication2.Window1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Window1"  
      Height="200" 
      Width="401px"  
      Background="Red" 
      SnapsToDevicePixels="True"&gt;
  &lt;Grid&gt;
      &lt;Rectangle Width="200" Height="50"  Fill="Blue" VerticalAlignment="Top" /&gt;
      &lt;ListBox Height="94" VerticalAlignment="Bottom"  Width="200px" &gt;
          &lt;ListBoxItem&gt;1&lt;/ListBoxItem&gt;
          &lt;ListBox.Template&gt;
              &lt;ControlTemplate TargetType="ListBox"&gt;
                  &lt;ScrollViewer Margin="0" Padding="0" SnapsToDevicePixels="True"&gt;
                      &lt;StackPanel Margin="0" IsItemsHost="True" Width="200" Background="GreenYellow"/&gt;
                  &lt;/ScrollViewer&gt;
              &lt;/ControlTemplate&gt;
          &lt;/ListBox.Template&gt;
          &lt;ListBox.ItemContainerStyle&gt;
              &lt;Style TargetType="{x:Type ListBoxItem}"&gt;
                  &lt;Setter Property="SnapsToDevicePixels" Value="True"/&gt;
                  &lt;Setter Property="Width" Value="200"/&gt;
                  &lt;Setter Property="Template"&gt;
                      &lt;Setter.Value&gt;
                          &lt;ControlTemplate TargetType="ListBoxItem"&gt;
                              &lt;Grid Background="Green" Height="40" SnapsToDevicePixels="True"&gt;
                                  &lt;ContentPresenter SnapsToDevicePixels="True"/&gt;
                              &lt;/Grid&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
          &lt;/ListBox.ItemContainerStyle&gt;
      &lt;/ListBox&gt;
  &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>