示例#1
0
        /// <summary>
        /// Initializing the User Interface
        /// </summary>
        public override void load()
        {
            SearchProgressVisibility = "Visible";
            if (isNewAgentAuthentication)
            {
                ProgressBarPercentValue = -1;
                AuthenticatedUserModel.Agent.WebServiceCredential = SecurityLoginViewModel.TxtLicenseKey;
                _startup.Dal.SetUserCredential(AuthenticatedUserModel.Agent, CompanyName, isNewAgentAuthentication);
                isNewAgentAuthentication = false;
                ProgressBarPercentValue  = 100;
            }
            else if (SecurityLoginViewModel.AgentModel.Agent.ID != 0)
            {
                _startup.Dal.ProgressBarFunc = progressBarManagement;
                AuthenticatedUserModel.Agent.WebServiceCredential = SecurityLoginViewModel.TxtLicenseKey;
                _startup.Dal.SetUserCredential(AuthenticatedUserModel.Agent, CompanyName);
            }

            CommandNavig.raiseCanExecuteActionChanged();
            AgentViewModel.GetCurrentAgentCommand.raiseCanExecuteActionChanged();

            // display the chat view
            ChatRoomCurrentView = ChatRoomViewModel;

            // start the chat application
            //ChatRoomViewModel.start();
        }
示例#2
0
        //----------------------------[ Event Handler ]------------------

        /// <summary>
        /// event listener to load UI data on authenticated user change
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void onAuthenticatedAgentChange(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName.Equals("Agent"))
            {
                if (Startup.Bl.BlSecurity.IsUserAuthenticated())
                {
                    load();
                }
                onPropertyChange("AuthenticatedUserModel");
                onPropertyChange("TxtUserName");
                CommandNavig.raiseCanExecuteActionChanged();
            }
        }