using System;
using System.ComponentModel.Composition;
using GalaSoft.MvvmLight.Messaging;
using TaskIt.Core;
using TaskIt.Modules.Help.Assets.Resources;
using TaskIt.ViewModels;

namespace TaskIt.Modules.Help.ViewModels
{
    [Export]
    public class HelpPageViewModel : WidgetViewModelBase
    {
        private Uri _htmlSourceUri;

        public HelpPageViewModel()
        {
            Messenger.Default.Register<ViewHtmlArgs>(this, OnViewHtml);
        }

        private void OnViewHtml(ViewHtmlArgs args)
        {
            HtmlSourceUri = new Uri(args.SourceUrl, UriKind.Absolute);            
            NotifyViewHtml();
        }

        # region Properties

        public Uri HtmlSourceUri
        {
            get { return _htmlSourceUri; }
            set { _htmlSourceUri = value; this.OnPropertyChanged("HtmlSourceUri"); }
        }

        # endregion

        # region Resource Strings

        public string ResourceWidgetTitleGTDOverview
        {
            get { return HelpStrings.WidgetTitle_GTDOverview; }
        }

        public string ResourceWidgetTitleBlogPosts
        {
            get { return HelpStrings.WidgetTitle_BlogPosts; }
        }

        public string ResourceWidgetTitleVideos
        {
            get { return HelpStrings.WidgetTitle_Videos; }
        }

        public string ResourceWidgetTitleWebinars
        {
            get { return HelpStrings.WidgetTitle_Webinars; }
        }

        # endregion

    }
}