title: How to bind to a singleton property in Silverlight 4?
body: <p>Hi all first post here :)
  Let's start with a snippet of the code I'm using:</p>
  
  <pre><code>public MyClass : INotifyPropertyChanged
  {
    private static MyClass _instance;
    public static MyClass Instance
    {
        get
        {
            if (_instance == null)
                _instance = new MyClass();
            return _instance;
        }
    }
  
    private bool _myProperty;
    public bool MyProperty
    {
        get
        {
          return _myProperty;
        }
        set
        {
            if (_myProperty!= value)
            {
                _myProperty= value;
                NotifyPropertyChanged("MyProperty");
            }
        }
     }
  
     private MyClass() { ... }
  }
  </code></pre>
  
  <p>As you can see, it's a singleton class.
  In my view, I want to bind a control on MyProperty. My initial idea was to import MyClass as a static ressource in my view using something like:</p>
  
  <pre><code>&lt;UserControl x:Class="Metrics.Silverlight.ChartView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:logic="clr-namespace:Metrics.Logic;assembly=Metrics.Logic"&gt;
    &lt;UserControl.Resources&gt;
      &lt;logic:MyClass x:Key="myClass" /&gt;
    &lt;/UserControl.Resources&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>And bind it like so:</p>
  
  <pre><code>&lt;Button Margin="5" Click="btnName_Click"  Visibility="{Binding Source={StaticResource myClass}, Converter={StaticResource visibilityConverter}, Path=MyAttribute, Mode=OneWay}"&gt;
  </code></pre>
  
  <p>Of course, this approach won't work since MyClass constructor's is private. I also cannot use x:static since it's not available in Silverlight 4.</p>
  
  <p>I've been stuck on this problem far longer than I should have...
  How can I bind on MyProperty?</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance!</p>