using System;
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Browser;
using TaskIt.Core;
using TaskIt.Modules.Help.ViewModels;

namespace TaskIt.Modules.Help.Views
{
    public partial class GTDOverview
    {
        public GTDOverview()
        {
            InitializeComponent();
            CompositionInitializer.SatisfyImports(this);
            DataContext = ViewModel;
            Loaded += OnLoaded;

            ViewModel.NavigateToUrl += OnNavigateToUrl;
        }

        void OnLoaded(object sender, RoutedEventArgs e)
        {
            Utils.SetFocus(RadBook1);
        }

        static void OnNavigateToUrl(object sender, RoutedEventArgs e)
        {
            HtmlPage.Window.Navigate(new Uri("http://www.davidco.com/", UriKind.Absolute), "_blank");
        }

        [Import]
        public GTDOverviewViewModel ViewModel { get; set; }
    }
}
