Hello,
Welcome to our Microsoft Q&A platform!
Sorry for the mistake, it unnecessary to add a click event. Just get the instance of the ImageView
and change the Visibility property's value.
HomePage class
public partial class HomePage : ContentPage
{
...
private void Button_Clicked(object sender, EventArgs e)
{
var value = Shell.GetTabBarIsVisible(this);
Shell.SetTabBarIsVisible(this, !value);
MessagingCenter.Send<HomePage, bool>(this, "Hi", !value);
}
}
ShellItemRenderer class
public class TodoShellItemRenderer : ShellItemRenderer
{
public TodoShellItemRenderer(IShellContext shellContext) : base(shellContext)
{
MessagingCenter.Subscribe<ProfilePage, bool>(this, "Hi", (s, arg) =>
{
if (arg)
{
image.Visibility = ViewStates.Visible;
}
else
{
image.Visibility = ViewStates.Gone;
}
});
}
ImageView image;
private async void SetupLargeTab()
{
image = new ImageView(Context);
...
}
}
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.