public void OnPlayCompositionFromHub(Guid compositionId) { Repository.DataService.Composition c = (from a in Compositions where a.Id == compositionId select a).Single(); IUnityContainer container = Unity.Container; _playbackSservice = (CompositionService)container.Resolve<ICompositionService>(); _playbackSservice.CompositionId = c.Id.ToString(); _playbackSservice.CompositionLoadingComplete += GetCompositionForPlayComplete; _playbackSservice.CompositionLoadingError += GetCompositionForPlayError; _playbackSservice.GetCompositionAsync(); }
protected override void RegisterViewsAndServices() { Container.RegisterType<ICompositionViewModel, CompositionViewModel>(new ContainerControlledLifetimeManager()); Container.RegisterType<IBarsView, BarsView>(); Container.RegisterType<IPrintView, PrintView>(); Container.RegisterType<IUIScaleView, UIScaleView>(); Container.RegisterType<IProvenanceView, ProvenanceView>(); Container.RegisterType<IBusyIndicatorView, BusyIndicatorView>(); Container.RegisterType<IEditPopupView, EditPopupView>(); Container.RegisterType<INoteEditorView, NoteEditorView>(); Container.RegisterType<IPlaybackControlsView, PlaybackControlsView>(); Container.RegisterType<ILyricsPanelView, LyricsPanelView>(); Container.RegisterType<IPlaybackControlsViewModel, PlaybackControlsViewModel>(); Container.RegisterType<ISavePanelView, SavePanelView>(); Container.RegisterType<ICollaborationPanelView, CollaborationPanelView>(); Container.RegisterType<ITranspositionView, TranspositionView>(); Container.RegisterType<INewCompositionPanelView, NewCompositionPanelView>(); Container.RegisterInstance(typeof(ICompositionService), new CompositionService(), new ContainerControlledLifetimeManager()); Container.RegisterInstance(typeof(IHubCompositionsService), new HubCompositionsService(), new ContainerControlledLifetimeManager()); Container.RegisterType<IHubView, HubView>(); _service = (CompositionService)Container.Resolve<ICompositionService>(); Container.RegisterInstance(typeof(BarsViewModel), new BarsViewModel(), new ContainerControlledLifetimeManager()); Container.RegisterInstance(typeof(ProvenanceViewModel), new ProvenanceViewModel(), new ContainerControlledLifetimeManager()); Container.RegisterInstance(typeof(DataServiceRepository<Repository.DataService.Composition>), new DataServiceRepository<Repository.DataService.Composition>(), new ContainerControlledLifetimeManager()); }