Jason Dolinger in his video located here (hot available right now) www.lab49.com/files/videos/Jason%20Dolinger%20MVVM.wmv (from 0.59 to 1.04) uses such code:
public partial App: Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
IUnityContainer container = new UnityContainer();
RandomQuoteSource source = new RandomQuoteSource();
container.RegisterInstance<IQuoteSource>(source);
WatchList window = container.Resolve<WatchList>();
window.Show();
}
}
He uses class IUnityContainer which I can not found. As I understand here we just create a window (so container.Resolve
call can be replaced with new WatchList(...
, also somehow we associate RandomQouteSource
as an implementation for IQouteSource
, however I don't have clear understanding how this should be used later.
The questions are:
- how do you create main Windows in your MVVM application, do you also use IUnityContainer for that?
- is it good technics in general? is it well-known? is it default way to do these things? what alternativies do I have?
- where can I find Microsoft.Practicies.Unity.dll?