Beispiel #1
0
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            //Theme.Initialize(); -- already done in StandardWindow base class

            InitializeComponent();

            Application.Current.SessionEnding += Current_SessionEnding;
            Application.Current.Exit          += Current_Exit;

            HourglassState = 2;
            WPFDoEvents.SetHourglassCursor();

            DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            Title = String.Format("Qiqqa v{0}", ClientVersion.CurrentBuild);
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = String.Format("Qiqqa v{0} (TEST ENVIRONMENT)", ClientVersion.CurrentBuild);
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            SizeChanged += MainWindow_SizeChanged;
            KeyUp       += MainWindow_KeyUp;

            //Unloaded += MainWindow_Unloaded;
            Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
            Closing += MainWindow_Closing;
            Closed  += MainWindow_Closed;

            // We've looked for the LAST event that triggers dependably at the start of the application:
            //   ContentRendered
            // is the last one triggered of this bunch:
            //
            //this.Activated += MainWindow_Activated;
            ContentRendered += MainWindow_ContentRendered;
            //this.Initialized += MainWindow_Initialized;
            //this.LayoutUpdated += MainWindow_LayoutUpdated;
            //this.Loaded += MainWindow_Loaded;
            //this.ManipulationCompleted += MainWindow_ManipulationCompleted;
            //this.ManipulationStarting += MainWindow_ManipulationStarting;
            //this.SourceInitialized += MainWindow_SourceInitialized;
            //this.StateChanged += MainWindow_StateChanged;

            WebLibraryManager.Instance.WebLibrariesChanged += Instance_WebLibrariesChanged;
        }
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            InitializeComponent();

            this.DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = "Qiqqa (TEST ENVIRONMENT)";
            }
            else
            {
                Title = "Qiqqa";
            }

            // Check that we actually are fitting on the user's screen
            if (this.Left > SystemParameters.VirtualScreenWidth || this.Width > SystemParameters.FullPrimaryScreenWidth)
            {
                this.Left  = 0;
                this.Width = SystemParameters.FullPrimaryScreenWidth;
            }
            if (this.Top > SystemParameters.VirtualScreenHeight || this.Height > SystemParameters.FullPrimaryScreenHeight)
            {
                this.Top    = 0;
                this.Height = SystemParameters.FullPrimaryScreenHeight;
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            this.SizeChanged += MainWindow_SizeChanged;
            this.KeyUp       += MainWindow_KeyUp;

            this.Closing += MainWindow_Closing;
            this.Closed  += MainWindow_Closed;

            ObjTabWelcome.GetGoing += ObjTabWelcome_GetGoing;

            // Put this in a background thread
            Dispatcher.BeginInvoke(((Action)(() => PostStartupWork())), DispatcherPriority.Normal);
        }
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            Theme.Initialize();

            InitializeComponent();

            WPFDoEvents.SetHourglassCursor();

            DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            Title = String.Format("Qiqqa v{0}", ClientVersion.CurrentBuild);
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = String.Format("Qiqqa v{0} (TEST ENVIRONMENT)", ClientVersion.CurrentBuild);
            }

            // Check that we actually are fitting on the user's screen
            if (Left > SystemParameters.VirtualScreenWidth || Width > SystemParameters.FullPrimaryScreenWidth)
            {
                Left  = 0;
                Width = SystemParameters.FullPrimaryScreenWidth;
            }
            if (Top > SystemParameters.VirtualScreenHeight || Height > SystemParameters.FullPrimaryScreenHeight)
            {
                Top    = 0;
                Height = SystemParameters.FullPrimaryScreenHeight;
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            SizeChanged += MainWindow_SizeChanged;
            KeyUp       += MainWindow_KeyUp;

            Closing += MainWindow_Closing;
            Closed  += MainWindow_Closed;

            // We've looked for the LAST event that triggers dependably at the start of the application:
            //   ContentRendered
            // is the last one triggered of this bunch:
            //
            //this.Activated += MainWindow_Activated;
            ContentRendered += MainWindow_ContentRendered;
            //this.Initialized += MainWindow_Initialized;
            //this.LayoutUpdated += MainWindow_LayoutUpdated;
            //this.Loaded += MainWindow_Loaded;
            //this.ManipulationCompleted += MainWindow_ManipulationCompleted;
            //this.ManipulationStarting += MainWindow_ManipulationStarting;
            //this.SourceInitialized += MainWindow_SourceInitialized;
            //this.StateChanged += MainWindow_StateChanged;

            // Put this in a background thread
            SafeThreadPool.QueueUserWorkItem(o => PostStartupWork());
        }