title: Permanently Enabled Scrollbars Possible?
body: <p>I am having a problem trying to come up with a way to keep <code>ScrollBars/ScrollViewers</code> permanently enabled.  I am working on a Data Entry application where certain users might only have "read" rights.  This needs to disabled all controls so they are not able to make any changes.  </p>
  
  <p>When a control is disabled the user cannot view all information in scrollable controls (Infragistics <code>XamDataGrid</code>, DevExpress <code>GridControl</code>, <code>TextBox</code>es with Wrap, <code>ListBox</code>, etc).  I was hoping I could "outsmart" Microsoft, and implement a <code>Trigger</code> to set <code>IsEnabled</code> to true when it was set to false, but of course, it didn't work (for a variety of reasons, I'm sure).</p>
  
  <p>I've been focusing strictly on a textbox for now, to try to disabled the contents, but keep the <code>ScrollViewer</code> enabled and have had no luck.  </p>
  
  <p>I was hoping there might be a solution, I.E. Overriding the <code>IsEnabled</code> dependency property of the <code>ScrollViewer</code> to always return true, or provide some sort of <code>Style</code> that does not allow for the <code>ScrollViewer</code> to become disabled.</p>
  
  <p>I know a <code>TextBox</code> has an <code>IsReadOnly</code> property, but this is of no use for many of the other controls I need to resolve this issue for.</p>
  
  <p>Is there any way I can go about solving this, in a fairly simple manner (simple as in that I can make a style that's applied everywhere, without changing the 200+ code files).</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong>  Here is the code I'm using in a sample project to try to resolve this issue.</p>
  
  <pre><code>&lt;Window x:Class="WPFScrollViewerStyles.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="MainWindow" Height="350" Width="525"&gt;
  &lt;Window.Resources&gt;
      &lt;Style BasedOn="{x:Null}" TargetType="{x:Type TextBox}"&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                      &lt;Microsoft_Windows_Themes:ListBoxChrome x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" SnapsToDevicePixels="true"&gt;
                          &lt;ScrollViewer x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Visible" 
                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsEnabled="True" /&gt;
                      &lt;/Microsoft_Windows_Themes:ListBoxChrome&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsEnabled" Value="false"&gt;
                              &lt;Setter Property="IsEnabled" Value="True" TargetName="PART_ContentHost" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  &lt;Grid IsEnabled="False"&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="100" /&gt;
          &lt;ColumnDefinition Width="100" /&gt;
          &lt;ColumnDefinition Width="100" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="100" /&gt;
          &lt;RowDefinition Height="100" /&gt;
          &lt;RowDefinition Height="100" /&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;TextBox x:Name="txtScroller" Width="100" Height="100" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" ScrollViewer.CanContentScroll="True"&gt;
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras faucibus hendrerit lorem, auctor vehicula sem molestie nec. Quisque non massa quam. Nullam tempor blandit tempor. Integer in molestie ipsum. Donec augue mi, auctor vitae scelerisque a, vehicula ac ipsum. Etiam posuere vulputate augue quis convallis. Nullam aliquet purus nec lacus fermentum hendrerit egestas purus tincidunt. Suspendisse quis lacinia libero. Quisque facilisis turpis at augue dignissim aliquam ultrices sem porta. Etiam sagittis arcu id nibh ultrices dictum. Nulla non lectus luctus est malesuada luctus. Praesent sed lobortis nisi. Morbi et porttitor massa. Sed pellentesque, nisl eu imperdiet varius, ligula augue cursus nisl, eu egestas metus velit non elit. Phasellus elementum hendrerit risus, eu tincidunt ante gravida vel.
      &lt;/TextBox&gt;
  
      &lt;ListBox x:Name="lstScroller" Width="100" Height="100" Grid.Column="1"&gt;
          &lt;ListBox.Items&gt;
              &lt;ListBoxItem Content="Item 1" /&gt;
              &lt;ListBoxItem Content="Item 2" /&gt;
              &lt;ListBoxItem Content="Item 3" /&gt;
              &lt;ListBoxItem Content="Item 4" /&gt;
              &lt;ListBoxItem Content="Item 5" /&gt;
              &lt;ListBoxItem Content="Item 6" /&gt;
              &lt;ListBoxItem Content="Item 7" /&gt;
              &lt;ListBoxItem Content="Item 8" /&gt;
              &lt;ListBoxItem Content="Item 9" /&gt;
              &lt;ListBoxItem Content="Item 10" /&gt;
              &lt;ListBoxItem Content="Item 11" /&gt;
              &lt;ListBoxItem Content="Item 12" /&gt;
              &lt;ListBoxItem Content="Item 13" /&gt;
              &lt;ListBoxItem Content="Item 14" /&gt;
              &lt;ListBoxItem Content="Item 15" /&gt;
          &lt;/ListBox.Items&gt;
      &lt;/ListBox&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>