Exemplo n.º 1
0
        public MainWindow()
        {
            // 启动后不现实任务栏图标!
            this.ShowInTaskbar = false;
            InitializeComponent();
            this.Title = "小蓝人服务";
            PageContainer.Init(this.CtrlsContainer);
            PageContainer.Open(Page.State);

            this.topMenu.ItemsSource = new TopMenus(this);
        }
Exemplo n.º 2
0
        public static void Init(PageContainer PC)
        {
            var builder = new ContainerBuilder();

            builder.RegisterInstance <PageContainer>(PC);
            builder.RegisterInstance <WebPage>(new WebPage());
            builder.RegisterInstance <StatePage>(new StatePage());
            builder.RegisterInstance <SettingPage>(new SettingPage());
            builder.RegisterInstance <SpeechPage>(new SpeechPage());
            builder.RegisterInstance <LoadingPage>(new LoadingPage());

            Container = builder.Build();
        }
Exemplo n.º 3
0
        private void MenuItemSwitchClick(object sender, EventArgs e)
        {
            var r = e as RoutedEventArgs;

            if (r == null)
            {
                return;
            }
            var menu = r.Source as MenuItem;

            if (menu == null)
            {
                return;
            }
            var param = menu.CommandParameter;

            if (param == null)
            {
                return;
            }
            var route = param.FromJson <PageRoute>();

            PageContainer.Open(route);
        }