Force reload views maui (Using the Tab Bar to navigate)

Mielesplayz 291 Reputation points
2022-12-12T08:07:20.137+00:00

Is it possible to make (all) your views reload with a button or directly trough the TabBar
I have some settings like "Language" and "Username", but I have no idea how to make the views reload after changing/saving the settings
Of course, I could just put them in a while loop that checks if the value changed, but that would be unnecessary use of resources.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,594 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 32,386 Reputation points Microsoft Vendor
    2022-12-13T06:45:33.73+00:00

    Hello @Mielesplayz ,

    Is it possible to make (all) your views reload with a button or directly trough the TabBar

    No, you cannot force update the view.

    It looks like you set many values on the Settings page, and you want other pages respond to the changes. If so, you can try to save the value in a key/value store, then override the Page.OnAppearing method to display the values or do some logic based on the values ​​you saved.

    In addition, it's recommended that you use the MVVM design pattern, then communicate with other ViewModels when the values changed. For more details, you can refer to Data binding and MVVM - .NET MAUI | Microsoft Learn

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.