protected override void Configure()
        {
            _container = new MefContainer();

            var batch = new CompositionBatch();

            batch.AddExportedValue <IWindowManager>(new WindowManager());
            batch.AddExportedValue <IEventAggregator>(new EventAggregator());
            batch.AddExportedValue(_container);

            _container.Compose(batch);
        }
 public FillOrderAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }
 public SellGrapeOrFieldAction(IEventAggregator eventAggregator, IMetroDialog metroDialog,
                               IMefContainer mefContainer) : base(eventAggregator)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }
Example #4
0
 public static void SetContainer(IMefContainer contianer)
 {
     _container = contianer;
 }
Example #5
0
 public NavigationService(Lazy <IAppViewModel> appViewModel, IMefContainer container)
 {
     _appViewModel = appViewModel;
     _container    = container;
 }
 public PlayerSelection(IMetroDialog metroDialog, IMefContainer mefContainer)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }
 protected PlayVisitorAction(IEventAggregator eventAggregator, IMetroDialog metroDialog,
                             IMefContainer mefContainer) : base(eventAggregator)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }
Example #8
0
 public BuildStructureAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }
 public PlayWinterVisitorAction(IEventAggregator eventAggregator, IMetroDialog metroDialog,
                                IMefContainer mefContainer) : base(eventAggregator, metroDialog, mefContainer)
 {
 }
Example #10
0
        public static T Resolve <T>(this IMefContainer container)
        {
            var service = container.Resolve(typeof(T), null);

            return(service is T ? (T)service : default(T));
        }
Example #11
0
 /// <summary>
 /// Requires T2 having parameterless constructor
 /// </summary>
 public static void Register <T, T2>(this IMefContainer container) where T2 : T, new()
 {
     container.RegisterFunc(() => new T2());
     container.RegisterFunc <T>(() => container.Resolve <T2>());
 }
Example #12
0
 public static void RegisterInstance <T>(this IMefContainer container, T instance)
 {
     container.RegisterInstance <T>(null, instance);
 }
Example #13
0
 public PlantVineAction(IEventAggregator eventAggregator, IMetroDialog metroDialog, IMefContainer mefContainer) : base(eventAggregator)
 {
     _metroDialog  = metroDialog;
     _mefContainer = mefContainer;
 }