Hello,
Welcome to our Microsoft Q&A platform!
If you want to change one ShellSection's IsEnable status, I suggest you can use MessageCenter to do this.
My ShellItems:
<ShellItem>
<ShellSection
x:Name="itempage"
Title="Browse"
Icon="tab_feed.png">
<ShellContent>
<local:ItemsPage />
</ShellContent>
</ShellSection>
<ShellSection
x:Name="aboutpage"
Title="About"
Icon="tab_about.png"
IsEnabled="False">
<ShellContent>
<local:AboutPage />
</ShellContent>
</ShellSection>
</ShellItem>
And subscribe to a message in AppShell.cs:
public AppShell()
{
InitializeComponent();
MessagingCenter.Subscribe<AppShell>(this, "Hi", (sender) =>
{
aboutpage.IsEnabled = true;
});
}
Sending one message in HandlingPage Contentpage:
private void btn1_Clicked(object sender, EventArgs e)
{
MessagingCenter.Send<AppShell>(new AppShell(),"Hi");
}
For more about MessageCenter, you can check : https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/messaging-center
Best Regards,
Jessie 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.