Похожие чаты

Before I start: I haven't worked on something like that so

please don't expect me to be able to give you information how to implement such a thing properly.
The answer:
I would try the following:
You have a page with a help button on it. If you click you create EventArgs containing the name of the page (nameof could be nice to use here to enable refactoring of strings).
Now you load the stuff which can be seen in your screenshots in the following way:
LoadHelp(EventArgs args);
In LoadHelp you create the buttons (visually).
Then you either load the default help page by say LoadDefaultPage();
or you call LoadPage(EventArgs args) with the args from above.
LoadPage now evaluates the args by the string you set within the onclick event in a way like:

// Notice that nameof could be again a good choice.
// Alternatively you could provide a static class
// or something containing constants like
// public static const string Login = "Login";
switch(args.PageName)
{
case("Login"):
// stuff
break;
case("Registrar"):
// stuff
break;
// more cases
default:
LoadDefaultPage();
break;
}

Now you don't have to "click" your buttons anymore but can process the event to a separate logic which handles not only your help-page buttons but the page buttons with the help button, too!

I hope this is understandable. Sorry, my english is not that good so I (maybe?) have to build strange sentences.

Again:
I never did this and I can't provide a "tutorial". I can notice though that your design looks smelly in case of maintainability and bug-awarness because of the chaining responsibility. In that special case it MAY work without problems but if you ever choose to redesign you could run into issues (IMHO)!

Maybe the other guys in this group can provide a much more solid solution for you.
In doubt consider asking your question again on stackoverflow.com.

2 ответов

4 просмотра

Please format the code you posted, by wrapping it in triple backticks. -> `

To be honest, it is confusing for me to comprehend this. I'll have to do a trial setup to try to understand how it all works. I understand a slight bit but I will try. Thanks

Похожие вопросы

Обсуждают сегодня

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
70
Здравствуйте. Задача состоит в том, чтобы сделать real-time чат в мобильном приложении. После передачи сообщения пользователем через веб-сокеты, для основного и долговременног...
🐾
5
Всем доброго дня, ребят подскажите пожалуйста, если в курсе по ассемблеру используется MASM32, могу ли я использовать FASM? В чем явная разница и будет ли у меня все работать?
Botsman
17
Добрый день, не подскажите, если в OC-V3 поменять страндартную директорию /storage/ на /storage2/ - не будет сильно много проблем ?
Max Dubovsky
32
падает джоба хотя уже была собрана на соседнем namespace, куда капать? │ │ Copying blob sha256:2fa066caddb8f09a71082b03aa43046f79346a01d9c89e06a1f508bb1207dba5 427 │ │ Copyin...
Andrei St
2
Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
25
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Книга Юрова В.И пойдёт для обучения?
Botsman
24
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
Люди добрые, помогите с идеями, потому что свои закончились. У клиента падает софтина в момент инициализации модуля OtlEventMonitor на RegisterWindowMessage('Gp/OtlTaskEvents/...
Михаил Усков
7
Карта сайта