// RibbonBackstageUICommandBase.cs
// Copyright (c) 2016 Bentley Systems, Incorporated. All Rights Reserved.

using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Input;

namespace Haestad.Framework.UI.Integration
{
	public abstract class RibbonBackstageUICommandBase : RibbonUICommand, IRibbonBackstageUICommand
	{
		#region Constructor
		public RibbonBackstageUICommandBase(ICommand command, string name, string labelKey, 
			string toolTipTitleKey, string toolTipDescriptionKey, string graphicResourceKey) 
			: base(command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey)
		{

		}
		public RibbonBackstageUICommandBase(ICommand command, string name, string labelKey, string toolTipTitleKey, 
			string toolTipDescriptionKey, string graphicResourceKey, string largeGraphicResourceKey) 
			: base(command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey, largeGraphicResourceKey)
		{

		}
		public RibbonBackstageUICommandBase(ICommand command, string name, string labelKey, string toolTipTitleKey, string toolTipDescriptionKey,
            string graphicResourceKey, string largeGraphicResourceKey, RibbonHotKey hotKey)
			: base(command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey, largeGraphicResourceKey, hotKey)
		{

		}
        #endregion

        #region IRibbonBackstageUICommand Members
        public UserControl GetBackstageUserControl()
		{
			return BackstageUserControl;
		}

        public abstract IList<IRibbonUICommand> BackstageUserControlCommands { get; }
        #endregion

        #region Protected Abstract Methods
        protected abstract UserControl NewBackstageUserControl();
		protected abstract void ConfigureBackstageUserControl();
        #endregion

        #region Protected Properties
        protected UserControl BackstageUserControl
		{
			get
			{
				if (m_backstageUserControl == null)
				{
					m_backstageUserControl = NewBackstageUserControl();
					ConfigureBackstageUserControl();
				}
				return m_backstageUserControl;
			}
		}
		#endregion

		#region Private Fields
		private UserControl m_backstageUserControl;
		#endregion
	}
}
