Adding a static object to a resource dictionary
Unfortunately it is not possible from XAML. But you can add the singleton object to the resources from code-behind:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e) {
base.OnStartup(e);
Resources.Add("MySingleton", Singleton.Instance);
}
}
It is possible in XAML:
<!-- assuming the 'my' namespace contains your singleton -->
<Application.Resources>
<x:StaticExtension Member="my:Singleton.Instance" x:Key="MySingleton"/>
</Application.Resources>