static DashBoardViewModel()
        {
            AddBackMenu = new Events.RegisterMenu
            {
                Caption = "Home",
                Id = "Menu.Home",
                Add = true,
                Action = () =>
                {
                    ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(
                    new Core.Events.SwitchTask
                    {
                        Task = new DashBoardViewModel()
                    });
                    ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(RemoveBackMenu);
                }
            };

            RemoveBackMenu = new Events.RegisterMenu
            {
                Id = "Menu.Home",
                Add = false
            };

            AddBackPwdMenu = new Events.RegisterMenu
            {
                Caption = "Home",
                Id = "Menu.Home",
                Add = true,
                Action = () =>
                    {
                        ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(
                            new Events.ShowDialog
                            {
                                Dialog = new PasswordDialogViewModel("856039")
                                {
                                    Yes = () =>
                                    {
                                        ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(
                                            new Core.Events.SwitchTask
                                            {
                                                Task = new DashBoardViewModel()
                                            });
                                        ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(RemoveBackMenu);
                                    }
                                }
                            });
                    }
            };
        }
Пример #2
0
        public override void OnCreateMenu()
        {
            MenuItem = new Events.RegisterMenu
            {
                Caption = "Terug",
                Id = Id,
                Add = true,
                Action = () =>
                {
                    BackAction();
                }
            };

            ServiceProvider.Instance.GetService<EventAggregator>().PublishOnUIThread(MenuItem);

            this.Menu.OnCreateMenu();
        }