/// <summary> /// Handles the Loaded event of the MainDisplay control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void MainDisplay_Loaded(object sender, RoutedEventArgs e) { //Ensure that the window is active on start this.Activate(); _imageUtils = new ImageUtils(); _fileLoader = new FileLoader(); //set mouse idle timer _timeoutToHide = TimeSpan.FromSeconds(2); MouseIdle = new DispatcherTimer(); MouseIdle.Interval = TimeSpan.FromSeconds(1); MouseIdle.Tick += new EventHandler(MouseIdleChecker); MouseIdle.Start(); //Load config LoadConfiguration(); SetBookmarkMenus(); if (Configuration.Windowed) { SetWindowMode(WindowMode.Windowed); } //gray out resume last file if the files dont't exist if (Configuration.Resume != null) { foreach (string file in Configuration.Resume.Files) { if (!File.Exists(file)) { ResumeFile_MenuBar.IsEnabled = false; ResumeFile_RightClick.IsEnabled = false; } } } else { ResumeFile_MenuBar.IsEnabled = false; ResumeFile_RightClick.IsEnabled = false; } _scrollValueHorizontal = (int)(ScrollField.ViewportHeight * 0.05); _scrollValueVertical = (int)(ScrollField.ViewportWidth * 0.05); _imageUtils.ScreenHeight = (int)ScrollField.ViewportHeight; _imageUtils.ScreenWidth = (int)ScrollField.ViewportWidth; //open file (when opening associated by double click) if (_openingFile != null) { LoadAndDisplayComic(false); } }
/// <summary> /// Handles the Loaded event of the MainDisplay control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void MainDisplay_Loaded(object sender, RoutedEventArgs e) { //Ensure that the window is active on start Activate(); _imageUtils = new ImageUtils(); _fileLoader = new FileLoader(); //set mouse idle timer _timeoutToHide = TimeSpan.FromSeconds(2); MouseIdle = new DispatcherTimer {Interval = TimeSpan.FromSeconds(1)}; MouseIdle.Tick += MouseIdleChecker; MouseIdle.Start(); //Load config LoadConfiguration(); SetBookmarkMenus(); if (Configuration.Windowed) { SetWindowMode(WindowMode.Windowed); } //gray out resume last file if the files dont't exist if (Configuration.Resume != null) { foreach (string file in Configuration.Resume.Files) { if (!System.IO.File.Exists(file)) { ResumeFile_MenuBar.IsEnabled = false; ResumeFile_RightClick.IsEnabled = false; } } } else { ResumeFile_MenuBar.IsEnabled = false; ResumeFile_RightClick.IsEnabled = false; } _scrollValueHorizontal = (int)(ScrollField.ViewportHeight * 0.05); _imageUtils.ScreenHeight = (int)ScrollField.ViewportHeight; _imageUtils.ScreenWidth = (int)ScrollField.ViewportWidth; //open file (when opening associated by double click) if (_openingFile != null) { LoadAndDisplayComic(false); } else { _comicBook = new ComicBook(); // KBR use an empty placeholder book } KeyGrid.ItemsSource = KeyHints; // TODO consider using an InformationWindow and show on the '?' key }