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

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

        public Brush Brush { get; set; }




        IUnityContainer container;
        public AdrMenu(IUnityContainer container)
        {
            string title = (string)Application.Current.TryFindResource("str.CustomMenu.Adr");
            Title = title;

            this.container = container;

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

        public void OnClick()
        {
            var p = this.container.Resolve<PgAddress>();
            FlyLayoutManager.NavigationService.Navigate(p);
        }
    }
}
