Bind to singleton

Topics: UI Architecture
Nov 30, 2011 at 12:14 PM

I have a UserViewModel that I use it in several areas of my app, so I made it a singleton. I'm currently injecting into the view models where needed and exposing it a property. Is there a way where I can reference a singleton on the view and bind directly to it rather than injecting into the view models?

Dec 4, 2011 at 9:55 PM
Edited Dec 4, 2011 at 9:56 PM

This has nothing to do with Caliburn per se but with general WPF/SL Data Binding. Try something like this:

{Binding Bar, Source={x:Static Demo:FooVM.Instance}}