Пример #1
0
        public MainViewModel(Border Stage)
        {
            AuthVM = new AuthenticationViewModel();

            LoginCommand       = new RelayCommand(DoLogin);
            LogoutCommand      = new RelayCommand(DoLogout, AuthVM.CanDoAuthenticated);
            NewControlCommand  = new RelayCommand(DoNewControl, CanDoNewControl);
            NewWindowCommand   = new RelayCommand(DoNewWindow, CanDoNewWindow);
            NewControl2Command = new RelayCommand(DoNewControl2, CanDoNewControl2);

            TheMenu = new List <MyMenuItem>
            {
                new MyMenuItem {
                    Header = "Log off", Command = LogoutCommand
                },
                new MyMenuItem {
                    Header   = "Other stuff",
                    Children = new List <MyMenuItem>
                    {
                        new MyMenuItem {
                            Header = "Load new control", Command = NewControlCommand
                        },
                        new MyMenuItem {
                            Header = "Load control v2", Command = NewControl2Command
                        },
                        new MyMenuItem {
                            Header = "Open new window", Command = NewWindowCommand
                        },
                    },
                },
            };

            ApplicationController.GetInstance().SetStage(Stage);
        }
Пример #2
0
        public MainViewModel(Border Stage)
        {
            AuthVM = new AuthenticationViewModel();

            LoginCommand = new RelayCommand(DoLogin);
            LogoutCommand = new RelayCommand(DoLogout, AuthVM.CanDoAuthenticated);
            NewControlCommand = new RelayCommand(DoNewControl, CanDoNewControl);
            NewWindowCommand = new RelayCommand(DoNewWindow, CanDoNewWindow);
            NewControl2Command = new RelayCommand(DoNewControl2, CanDoNewControl2);

            TheMenu = new List<MyMenuItem>
            {
                new MyMenuItem { Header = "Log off", Command = LogoutCommand },
                new MyMenuItem { Header = "Other stuff",
                    Children = new List<MyMenuItem>
                    {
                        new MyMenuItem { Header = "Load new control", Command = NewControlCommand },
                        new MyMenuItem { Header = "Load control v2", Command = NewControl2Command },
                        new MyMenuItem { Header = "Open new window", Command = NewWindowCommand },
                    },
                },
            };

            ApplicationController.GetInstance().SetStage(Stage);
        }