Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NControlDemo.App"/> class.
        /// </summary>
        /// <param name="typeResolveProvider">Type resolve provider.</param>
        public App (IContainerProvider containerProvider, Action<IContainerProvider> setupContainerCallback)
		{
            // Save container
            Container = containerProvider;

            // Only fill container if it has not been filled yet
            if (!_initialized)
            {
                _initialized = true;

                // Set up container
                SetupContainer();

                // Let the caller setup its container
                if (setupContainerCallback != null)
                    setupContainerCallback(Container);

                // Register views
                RegisterViews();
            }

            // The root page of your application
            //MainPage = Container.Resolve<MainViewXaml>();
            MainPage = Container.Resolve<MainView>();
		}
 protected virtual Page CreatePage(string segmentName)
 {
     return(_container.Resolve <object>(segmentName) as Page);
 }
Exemplo n.º 3
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     containerProvider.Resolve <IRegionManager>()
     .RegisterViewWithRegion(Constants.ContentRegion, typeof(WelcomeView));
 }
 public void OnInitialized(IContainerProvider containerProvider)
 {
     Logger = containerProvider.Resolve <ILogger>();
     RxApp.DefaultExceptionHandler = this;
 }
Exemplo n.º 5
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var reegionManager = containerProvider.Resolve <IRegionManager>();

            reegionManager.RegisterViewWithRegion(RegionNames.MAIN_NAVIGATION_REGION, typeof(SettingsNavigationView));
        }
        public void OnInitialized(IContainerProvider containerProvider)
        {
            IMenuRegistryProvider menuRegistry = containerProvider.Resolve <IMenuRegistryProvider>();

            menuRegistry.Register(new CustomersMenusRegistry());
        }
Exemplo n.º 7
0
 public void OnInitialized(IContainerProvider containerProvider) =>
 containerProvider
 .Resolve <IRegionManager>()
 .RegisterViewWithRegion("ContentRegion", typeof(ViewA))
 .RegisterViewWithRegion("ContentRegion", typeof(ViewB));
Exemplo n.º 8
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     _ = containerProvider.Resolve <ProgressDialogModel>();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Configure <see cref="MainWindowViewModel"/>.
 /// </summary>
 /// <param name="mainWindowViewModel"></param>
 /// <param name="container"></param>
 public void Configure(MainWindowViewModel mainWindowViewModel, IContainerProvider container)
 {
     mainWindowViewModel.Editor = container.Resolve <IEditorSkeleton>();
     mainWindowViewModel.Title  = container.Resolve <IEditorSkeleton>().Options.DefaultTitle;
 }
Exemplo n.º 10
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion("PrismContent", typeof(ExcelOptions));
        }
Exemplo n.º 11
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     regionManager.Regions[RegionNames.KeysRegion].Add(containerProvider.Resolve <KeysView>());;
 }
Exemplo n.º 12
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RequestNavigate(Given.MenuRegion, typeof(ButimeChapterView).FullName);
        }
Exemplo n.º 13
0
 public void OnInitialized(IContainerProvider containerProvider) =>
 containerProvider.Resolve <IRegionManager>()
 .RegisterViewWithRegion("AnalysisSettings", typeof(ReplayGainAnalysisSettingsControl));
Exemplo n.º 14
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(LocalRegions.LocationNavigationRegion, typeof(LocationManagmentNavigationView));
        }
Exemplo n.º 15
0
 private static IServiceA CreateServiceWithContainerProvider(IContainerProvider containerProvider) =>
 containerProvider.Resolve <IServiceA>(nameof(ServiceA));
Exemplo n.º 16
0
        internal static void RunModuleManager(IContainerProvider containerProvider)
        {
            IModuleManager manager = containerProvider.Resolve <IModuleManager>();

            manager.Run();
        }
Exemplo n.º 17
0
 /// <summary>
 /// Configure <see cref="OptionsControlViewModel"/>
 /// </summary>
 /// <param name="optionsViewModel"></param>
 /// <param name="container"></param>
 public void Configure(OptionsControlViewModel optionsViewModel, IContainerProvider container)
 {
     optionsViewModel.Options = container.Resolve <IEditorOptions>();
 }
Exemplo n.º 18
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion("ContentRegion", typeof(Views.CountryView));
        }
Exemplo n.º 19
0
        public LyricsControlViewModel(IContainerProvider container) : base(container)
        {
            this.container       = container;
            this.info            = container.Resolve <ILocalizationInfo>();
            this.metadataService = container.Resolve <IMetadataService>();
            this.playbackService = container.Resolve <IPlaybackService>();
            this.eventAggregator = container.Resolve <IEventAggregator>();
            this.i18NService     = container.Resolve <II18nService>();

            this.highlightTimer.Interval = this.highlightTimerIntervalMilliseconds;
            this.highlightTimer.Elapsed += HighlightTimer_Elapsed;

            this.updateLyricsAfterEditingTimer.Interval = this.updateLyricsAfterEditingTimerIntervalMilliseconds;
            this.updateLyricsAfterEditingTimer.Elapsed += UpdateLyricsAfterEditingTimer_Elapsed;

            this.refreshTimer.Interval = this.refreshTimerIntervalMilliseconds;
            this.refreshTimer.Elapsed += RefreshTimer_Elapsed;

            this.playbackService.PlaybackPaused  += (_, __) => this.highlightTimer.Stop();
            this.playbackService.PlaybackResumed += (_, __) => this.highlightTimer.Start();

            this.metadataService.MetadataChanged += (_) => this.RestartRefreshTimer();

            I18NService_LanguageChanged(null, null);
            this.i18NService.LanguageChanged += I18NService_LanguageChanged;

            SettingsClient.SettingChanged += (_, e) =>
            {
                if (SettingsClient.IsSettingChanged(e, "Lyrics", "DownloadLyrics"))
                {
                    if ((bool)e.Entry.Value)
                    {
                        this.RestartRefreshTimer();
                    }
                }
            };

            this.isNowPlayingPageActive       = SettingsClient.Get <bool>("FullPlayer", "IsNowPlayingSelected");
            this.isNowPlayingLyricsPageActive = ((NowPlayingSubPage)SettingsClient.Get <int>("FullPlayer", "SelectedNowPlayingSubPage")) == NowPlayingSubPage.Lyrics;

            this.eventAggregator.GetEvent <IsNowPlayingPageActiveChanged>().Subscribe(isNowPlayingPageActive =>
            {
                this.isNowPlayingPageActive = isNowPlayingPageActive;
                this.RestartRefreshTimer();
            });

            this.eventAggregator.GetEvent <IsNowPlayingSubPageChanged>().Subscribe(tuple =>
            {
                this.isNowPlayingLyricsPageActive = tuple.Item2 == NowPlayingSubPage.Lyrics;
                this.RestartRefreshTimer();
            });

            this.RefreshLyricsCommand = new DelegateCommand(() => this.RestartRefreshTimer(), () => !this.IsDownloadingLyrics);
            ApplicationCommands.RefreshLyricsCommand.RegisterCommand(this.RefreshLyricsCommand);

            this.playbackService.PlaybackSuccess += (_, e) =>
            {
                this.ContentSlideInFrom = e.IsPlayingPreviousTrack ? -30 : 30;
                this.RestartRefreshTimer();
            };

            this.ClearLyrics(null); // Makes sure the loading animation can be shown even at first start
        }
Exemplo n.º 20
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RequestNavigate("ContentRegion", "UserPlaylist");
        }
Exemplo n.º 21
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            IRegionManager regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion("ContentRegionModuleManual", typeof(ViewA));
        }
Exemplo n.º 22
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     var regionManager = containerProvider.Resolve <IRegionManager>();
     //regionManager.RegisterViewWithRegion("WinfromWrapperRegion", typeof(WinformPluginView));
 }
Exemplo n.º 23
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(RegionNames.SHELL_BOOKMARKS, containerProvider.Resolve <BookmarksView>);
        }
Exemplo n.º 24
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion("TopRegion", typeof(TopBar));
        }
Exemplo n.º 25
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion("LeftRegion", typeof(MessageView));
        }
Exemplo n.º 26
0
 public override void OnInitialized(IContainerProvider containerProvider)
 {
     base.OnInitialized(containerProvider);
     regionManager.RegisterViewWithRegion(RegionNames.RootRegion, () => containerProvider.Resolve <Welcome>());
 }
        private static object ServiceFactory(IContainerProvider container, Func <IServiceProvider, object> implementationFactory)
        {
            var sp = container.Resolve <IServiceProvider>();

            return(implementationFactory(sp));
        }
Exemplo n.º 28
0
        public CollectionArtistsViewModel(IContainerProvider container) : base(container)
        {
            // Dependency injection
            this.collectionService = container.Resolve <ICollectionService>();
            this.metadataService   = container.Resolve <IMetadataService>();
            this.playbackService   = container.Resolve <IPlaybackService>();
            this.playlistService   = container.Resolve <IPlaylistService>();
            this.indexingService   = container.Resolve <IIndexingService>();
            this.dialogService     = container.Resolve <IDialogService>();
            this.searchService     = container.Resolve <ISearchService>();
            this.eventAggregator   = container.Resolve <IEventAggregator>();

            // Commands
            this.ToggleTrackOrderCommand             = new DelegateCommand(async() => await this.ToggleTrackOrderAsync());
            this.ToggleAlbumOrderCommand             = new DelegateCommand(async() => await this.ToggleAlbumOrderAsync());
            this.RemoveSelectedTracksCommand         = new DelegateCommand(async() => await this.RemoveTracksFromCollectionAsync(this.SelectedTracks), () => !this.IsIndexing);
            this.RemoveSelectedTracksFromDiskCommand = new DelegateCommand(async() => await this.RemoveTracksFromDiskAsync(this.SelectedTracks), () => !this.IsIndexing);
            this.AddArtistsToPlaylistCommand         = new DelegateCommand <string>(async(playlistName) => await this.AddArtistsToPlaylistAsync(this.SelectedArtists, playlistName));
            this.SelectedArtistsCommand        = new DelegateCommand <object>(async(parameter) => await this.SelectedArtistsHandlerAsync(parameter));
            this.ShowArtistsZoomCommand        = new DelegateCommand(async() => await this.ShowSemanticZoomAsync());
            this.AddArtistsToNowPlayingCommand = new DelegateCommand(async() => await this.AddArtistsToNowPlayingAsync(this.SelectedArtists));
            this.ShuffleSelectedArtistsCommand = new DelegateCommand(async() => await this.playbackService.EnqueueArtistsAsync(this.SelectedArtists, true, false));

            this.SemanticJumpCommand = new DelegateCommand <string>((header) =>
            {
                this.HideSemanticZoom();
                this.eventAggregator.GetEvent <PerformSemanticJump>().Publish(new Tuple <string, string>("Artists", header));
            });

            // Settings
            SettingsClient.SettingChanged += async(_, e) =>
            {
                if (SettingsClient.IsSettingChanged(e, "Behaviour", "EnableRating"))
                {
                    this.EnableRating = (bool)e.SettingValue;
                    this.SetTrackOrder("ArtistsTrackOrder");
                    await this.GetTracksAsync(this.SelectedArtists, null, this.SelectedAlbumKeys, this.TrackOrder);
                }

                if (SettingsClient.IsSettingChanged(e, "Behaviour", "EnableLove"))
                {
                    this.EnableLove = (bool)e.SettingValue;
                    this.SetTrackOrder("ArtistsTrackOrder");
                    await this.GetTracksAsync(this.SelectedArtists, null, this.SelectedAlbumKeys, this.TrackOrder);
                }
            };

            // PubSub Events
            this.eventAggregator.GetEvent <ShellMouseUp>().Subscribe((_) => this.IsArtistsZoomVisible = false);
            this.eventAggregator.GetEvent <ToggleArtistOrderCommand>().Subscribe((_) => this.ToggleArtistTypeAsync());

            // Events
            this.metadataService.MetadataChanged   += MetadataChangedHandlerAsync;
            this.indexingService.AlbumArtworkAdded += async(_, e) => await this.RefreshArtworkAsync(e.AlbumIds);

            // Set the initial ArtistOrder
            this.ArtistType = (ArtistType)SettingsClient.Get <int>("Ordering", "ArtistsArtistType");

            // Set the initial AlbumOrder
            this.AlbumOrder = (AlbumOrder)SettingsClient.Get <int>("Ordering", "ArtistsAlbumOrder");

            // Set the initial TrackOrder
            this.SetTrackOrder("ArtistsTrackOrder");

            // Set width of the panels
            this.LeftPaneWidthPercent  = SettingsClient.Get <int>("ColumnWidths", "ArtistsLeftPaneWidthPercent");
            this.RightPaneWidthPercent = SettingsClient.Get <int>("ColumnWidths", "ArtistsRightPaneWidthPercent");

            // Cover size
            this.SetCoversizeAsync((CoverSizeType)SettingsClient.Get <int>("CoverSizes", "ArtistsCoverSize"));
        }
Exemplo n.º 29
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(HanTemp.Infrastructure.Constants.RegionNames.RigthWindowCommandsRegion, typeof(Views.Menu));
        }
Exemplo n.º 30
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(nameof(Views.StatusBar), typeof(Views.StatusBar));
        }
Exemplo n.º 31
0
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve <IRegionManager>();

            regionManager.RegisterViewWithRegion(RegionNames.Launch, typeof(NotificationsButtonView));
        }