Native navigation
This commit is contained in:
18
salesbook.Maui/Core/Services/PageTitleService.cs
Normal file
18
salesbook.Maui/Core/Services/PageTitleService.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using salesbook.Shared.Core.Interface;
|
||||
|
||||
namespace salesbook.Maui.Core.Services;
|
||||
|
||||
public class PageTitleService(IDispatcher dispatcher) : IPageTitleService
|
||||
{
|
||||
public void SetTitle(string title)
|
||||
{
|
||||
dispatcher.Dispatch(() =>
|
||||
{
|
||||
if (Application.Current?.MainPage is NavigationPage nav &&
|
||||
nav.CurrentPage is ContentPage cp)
|
||||
{
|
||||
cp.Title = title;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user