I have TabbedPage in MAUI 8 and API level 34 .
I have multiple tabs loading 3 on each Tab change event,
1-I have applied Font to each child Tab as mentioned https://learn.microsoft.com/en-us/answers/questions/1867067/how-to-set-fontfamily-of-title-of-each-child-of-ne
2- When CurrentPagechange Event of TabbedPage fired i was loosing font for next loaded tab
and its fixed by help mentioned here https://learn.microsoft.com/en-us/answers/questions/1879004/on-currentpagechange-event-of-tabbedpage-custom-fo
Current Issue: On going on Next tab changed by CurrentPagechange Event fonts are fine and attached to title but when I reach to last Tab and return back to last but one i am loosing font but for next back till last tab fonts are attached and working fine.
I have tried with different technique to attach while back to last but one Tab but its not working.
Will some one help in this regards.
Not working
I am attaching below custom function on page load
CurrentPageChanged += OnCurrentPageChanged1;
int _TotalTabCount=getTotaltabCount();
private bool isProcessingPageChange = false;
private async void OnCurrentPageChanged1(object sender, EventArgs e)
{
// Prevent multiple triggers
if (isProcessingPageChange) return;
try
{
this.CurrentPageChanged -= OnCurrentPageChanged1;
var tabbedPage = (TabbedPage)sender;
DisplayContent _DisplayContent = (DisplayContent)tabbedPage.SelectedItem;
if (CurrentPage != null)
{
isProcessingPageChange = true;
await Dispatcher.DispatchAsync(async () =>
{
await LoadnextThreeTabfromCollectionAndBindToItemSourceoftabbedPae();
MainThread.BeginInvokeOnMainThread(() =>
{
try
{
if (Children.Count > 1)
{
if (_TotalTabCount != _DisplayContent.CurrentTabNumber)
{
CurrentPage = Children[1]; // Set the second tab as selected
}
}
}
catch (ArgumentOutOfRangeException ex)
{
}
});
isProcessingPageChange = false;
});
}
}
catch
{
}
finally
{
isProcessingPageChange = false;
this.CurrentPageChanged += OnCurrentPageChanged1;
}
}