using MultiLayout;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Media;
using Unity;

namespace FLY.Thick.Base.UI.CustomMenu
{
    public class PwMenu : IMenu
    {
        public string Title { get; private set; }

        public Brush Brush { get; set; }




        IUnityContainer container;
        public PwMenu(IUnityContainer container)
        {
            this.container = container;
            string title = (string)Application.Current.TryFindResource("str.CustomMenu.Pw");
            Title = title;

            Brush = new ImageBrush()
            {
                ImageSource = new ImageSourceConverter().ConvertFromString("pack://application:,,,/FLY.Thick.Base.UI;component/Images/timg.jpg") as ImageSource,
                Stretch = Stretch.UniformToFill
            };

        }

        public void OnClick()
        {
            if (!WdPassword.Authorize("PwManager"))
                return;

            var p = this.container.Resolve<PgPwManager>();
            FlyLayoutManager.NavigationService.Navigate(p);

        }
    }
}
