Пример #1
0
        public void LogoutAction()
        {
            LteInfoModel lim = Application.Current.FindResource("LteInfoModel") as LteInfoModel;

            lim.ClosePopup();
            lim.StopTimer();

            DslPageModel dpm = Application.Current.FindResource("DslPageModel") as DslPageModel;

            dpm.StopTimer();

            MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel;

            LoginFieldsVisibility           = Visibility.Visible;
            mwm.ButtonOverviewPageIsActive  = false;
            mwm.ButtonDSLPageIsActive       = false;
            mwm.ButtonLteInfoPageIsActive   = false;
            mwm.ButtonSyslogPageIsActive    = false;
            mwm.ButtonTR181PageIsActive     = false;
            mwm.ButtonPhonePageIsActive     = false;
            mwm.ButtonLanPageIsActive       = false;
            mwm.ButtonInterfacePageIsActive = false;
            mwm.ButtonControlsPageIsActive  = false;

            LoginButtonText        = "Login";
            mwm.LoginButtonContent = "Login";
        }
Пример #2
0
        private void changePage(string page)
        {
            if (object.Equals(FrameSource, null).Equals(false))
            {
                if (FrameSource.GetType().Equals(typeof(LteInfoPage)))
                {
                    LteInfoModel lte = Application.Current.FindResource("LteInfoModel") as LteInfoModel;
                    lte.StopTimer();
                }

                if (FrameSource.GetType().Equals(typeof(DslPage)))
                {
                    DslPageModel dsl = Application.Current.FindResource("DslPageModel") as DslPageModel;
                    dsl.StopTimer();
                }
            }

            if (page.Equals("login"))
            {
                FrameSource = new LoginPage();
            }
            else if (page.Equals("status"))
            {
                FrameSource = new StatusPage();
            }
            else if (page.Equals("overview"))
            {
                FrameSource = new OverviewPage();
            }
            else if (page.Equals("dsl"))
            {
                FrameSource = new DslPage();
            }
            else if (page.Equals("lte"))
            {
                FrameSource = new LteInfoPage();
            }
            else if (page.Equals("syslog"))
            {
                FrameSource = new SyslogPage();
            }
            else if (page.Equals("tr181"))
            {
                FrameSource = new TR181Page();
            }
            else if (page.Equals("phone"))
            {
                FrameSource = new PhonePage();
            }
            else if (page.Equals("lan"))
            {
                FrameSource = new LanPage();
            }
            else if (page.Equals("interface"))
            {
                FrameSource = new InterfacePage();
            }
            else if (page.Equals("controls"))
            {
                FrameSource = new ControlsPage();
            }
            else if (page.Equals("about"))
            {
                FrameSource = new AboutPage();
            }

            changeColor(page);
        }