M
M
mississippi2019-09-05 13:47:03
C++ / C#
mississippi, 2019-09-05 13:47:03

How to subscribe to the button click event of all child elements?

This question is of interest: Let's say we have: a Page page, a button on this page, and there are several instances of one View (ContentView), all of them are also on the Page page. These Views are nested within each other, and each of them has some function that must be executed when a button is pressed, which is located on the Page. How can this be implemented?
5d70e6fa343f4944173977.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Stepanov, 2019-11-01
@AsceticSoft

Not a very clear question, but if I understand correctly, then on bare XF without MVVM, simply set x:Name to interactive elements and hang an event on the button and in the event handler refer to your views by the names specified in x:Name, perform the necessary actions .. And if MVVM, then depending on the framework, everything is different. On ReactiveUI for example viaInteraction<TParam, TResult>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question