question

StefanoM-9408 avatar image
0 Votes"
StefanoM-9408 asked JarvanZhang-MSFT answered

Use the OnAppaering() method inside a ContentView

I am trying to implement a TabView. As the content of each Item I inserted pages that I had previously created, transforming them from ContentPage to ContentView. By doing this, however, it is no longer possible to use the override of the OnAppaering() and OnBackButtonPressed() methods. Is there a way to use these two methods within the ContentView?

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered

Hello,​

Welcome to our Microsoft Q&A platform!

The ContentView doesn't have the lifecycle events. Did you use Xamarin.Community.Toolkit.TabView to display the views? To detect the lifecycle events, try using contentPages instead and using Shell to for the template.

Here is a similar issue case that may help you.
https://docs.microsoft.com/en-us/answers/questions/170862/xamarin-bottom-custom-tab-bar.html

Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.