PwMenu.cs 1.06 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2
using MultiLayout;
using MultiLayout.UiModule;
3
using System.Windows;
潘栩锋's avatar
潘栩锋 committed
4 5 6 7 8 9 10
using System.Windows.Media;
using Unity;

namespace FLY.Thick.Base.UI.CustomMenu
{
    public class PwMenu : IMenu
    {
11
        public string Title { get; private set; }
潘栩锋's avatar
潘栩锋 committed
12 13 14 15 16 17 18 19 20 21

        public Brush Brush { get; set; }




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

潘栩锋's avatar
潘栩锋 committed
25 26 27 28 29 30 31 32
            Brush = new ImageBrush()
            {
                ImageSource = new ImageSourceConverter().ConvertFromString("pack://application:,,,/FLY.Thick.Base.UI;component/Images/timg.jpg") as ImageSource,
                Stretch = Stretch.UniformToFill
            };

        }

潘栩锋's avatar
潘栩锋 committed
33
        public void OnClick()
潘栩锋's avatar
潘栩锋 committed
34 35 36 37 38 39
        {
            if (!WdPassword.Authorize("PwManager"))
                return;

            var p = this.container.Resolve<PgPwManager>();
            FlyLayoutManager.NavigationService.Navigate(p);
潘栩锋's avatar
潘栩锋 committed
40

潘栩锋's avatar
潘栩锋 committed
41 42 43
        }
    }
}