t;/Paragraph&gt;
       &lt;/RichTextBox&gt;
       &lt;Button Name="swapper" Click="swapper_Click" Width="220"&gt;Swap styles&lt;/Button&gt;
   &lt;/StackPanel&gt;
&lt;/UserControl&gt;
</pre>
            <p>The following is C# code: </p>
            <pre xml:space="preserve">       private void swapper_Click(object sender, RoutedEventArgs e)
       {
           rtb.Style = this.Resources["NewStyle"] as Style;
       }
</pre>
            <p>This example is shown in operation in the <a href="https://www.w3.o