using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;

namespace WPF_Sample.Views
{
    /// <summary>
    /// Interaction logic for Help.xaml
    /// </summary>
    public partial class HelpViewer : Window
    {
        public HelpViewer()
        {
            InitializeComponent();
        }

        public void LoadHelp(string htmlFileName, string titleName)
        {
            string curDir = Directory.GetCurrentDirectory();
            webBrowser1.Source = new Uri(String.Format("file:///{0}/Help/{1}", curDir, htmlFileName), UriKind.RelativeOrAbsolute);
            lblSubLabel.Content = titleName;
        }

        private void webBrowser1_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            var html = webBrowser1.Document as mshtml.HTMLDocument;
            webBrowser1.MinHeight = html.body.offsetHeight;
        }

    }
}
