I have a resource declared in XAML like so:

```
<Window x:Class="Test.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Test"
    Title="MainWindow" Height="350" Width="525" Name="form1">
  <Window.Resources>
    <ObjectDataProvider x:Key="SingleRole" ObjectType="{x:Type local:SingleRole}" />
  </Window.Resources>
...
</Window>

```

I'm trying to get a reference to that object in code:

```
    private void button1_Click_1(object sender, RoutedEventArgs e)
    {
        SingleRole role = ????;
    }

```

How can I do that? I've tried FindResource and this.Resources["SingleRole"] but I can't seem to get it to work.