コード例 #1
0
        protected override void InitializeShell()
        {
            base.InitializeShell();
            this.InitializeWCFServices();

            Application.Current.MainWindow = (Window)this.Shell;

            if (SettingsClient.Get <bool>("General", "ShowOobe"))
            {
                BorderlessWindows10Window oobeWin = Container.Resolve <Oobe>();

                // These 2 lines are required to set the RegionManager of the child window.
                // If we don't do this, regions on child windows are never known by the Shell
                // RegionManager and navigation doesn't work
                RegionManager.SetRegionManager(oobeWin, Container.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();

                // Show the OOBE window. Don't tell the Indexer to start.
                // It will get a signal to start when the OOBE window closes.
                LogClient.Info("Showing Oobe screen");
                oobeWin.Show();
                oobeWin.ForceActivate();
            }
            else
            {
                LogClient.Info("Showing Main screen");
                Application.Current.MainWindow.Show();

                // We're not showing the OOBE screen, tell the IndexingService to start.
                Container.Resolve <IIndexingService>().RefreshCollectionAsync();
            }
        }
コード例 #2
0
        public MiniPlayerPlaylist(BorderlessWindows10Window parent, IPlaybackService playbackService, IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            InitializeComponent();

            this.parent          = parent;
            this.playbackService = playbackService;
            this.regionManager   = regionManager;
            this.eventAggregator = eventAggregator;

            SettingsClient.SettingChanged += (_, e) =>
            {
                if (SettingsClient.IsSettingChanged(e, "Appearance", "ShowWindowBorder"))
                {
                    this.WindowBorder.BorderThickness = new Thickness((bool)e.SettingValue ? 1 : 0);
                }
            };

            this.eventAggregator.GetEvent <ToggledCoverPlayerAlignPlaylistVertically>().Subscribe(async alignPlaylistVertically =>
            {
                this.alignCoverPlayerPlaylistVertically = alignPlaylistVertically;
                if (this.IsVisible)
                {
                    await this.SetGeometry();
                }
            });
        }
コード例 #3
0
        private void ShowDialog(BorderlessWindows10Window win)
        {
            foreach (BorderlessWindows10Window dlg in this.openDialogs)
            {
                dlg.IsOverlayVisible = true;
            }

            this.openDialogs.Add(win);
            this.DialogVisibleChanged(this.openDialogs.Count > 0);

            win.ShowDialog();
            this.openDialogs.Remove(win);
            this.DialogVisibleChanged(this.openDialogs.Count > 0);

            foreach (BorderlessWindows10Window dlg in this.openDialogs)
            {
                dlg.IsOverlayVisible = false;
            }
        }