protected function getOnInitScriptText()
    {
        $scriptText = null;
        if ($this->control) {
            $controlId  = Builder::escapeText($this->control->getId());
            $scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});";
        } else {
            $scriptText = "declare ToggleInterfaceControl <=> Page.MainFrame;";
        }
        $stateVariableName = $this::VAR_STATE;
        return $scriptText . "
declare persistent {$stateVariableName} as CurrentState for LocalUser = True;
ToggleInterfaceControl.Visible = CurrentState;
";
    }