public void ContainerPreRegist(WinRTContainer container)
 {
     container.RegisterWinRTServices();
     container.RegisterSharingService();
     container
         .PerRequest<MainViewModel>();
 }
示例#2
0
        protected override void Configure()
        {
            // set logger
            // TODO: demo customization only
            LogManager.GetLog = type => new DebugLog();

            _container = new WinRTContainer();
            _container.RegisterWinRTServices();

            // all are singleton, so they won't be recreated
            _container.Singleton<MainViewModel>()
                .Singleton<PatternsViewModel>()
                .Singleton<SoundViewModel>()
                .Singleton<BingoCardViewModel>()
                .Singleton<BallCallsViewModel>()
                .Singleton<PlayerInfoViewModel>()
                .PerRequest<PatternCountViewModel>();

            // need this to allow sharing
            _container.RegisterSharingService();

            // avoid static class
            _container.RegisterInstance(typeof(Bookkeeper), "Bookkeeper", new Bookkeeper(_container.GetInstance<IEventAggregator>()));

            PrepareSettings();
        }