Exemplo n.º 1
0
        public void OpenHelpWindow(string helpFileName)
        {
            if (currentOpenHelpWindow == null)
            {
                currentOpenHelpWindow         = new HelpWindow();
                currentOpenHelpWindow.Closed += (sender, args) => currentOpenHelpWindow = null;
                currentOpenHelpWindow.Show();
            }

            currentOpenHelpWindow.Focus();

            string applicationDirectory = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            string helpFile = GetHelpFilePath(helpFileName, clientConfigurationProvider.PackageFolderPath);

            if (!File.Exists(helpFile))
            {
                helpFile = GetHelpFilePath(helpFileName, applicationDirectory);
            }

            if (!File.Exists(helpFile))
            {
                messageBoxService.Warning(LocalizationLocator.MobileLocalization.HelpNotExistsWarning);
                Loggers.TechLogger.Warn(string.Format("Help file not exists {0}", helpFile));
                return;
            }

            currentOpenHelpWindow.help.Navigate(helpFile);
        }