18 lines
452 B
C#
18 lines
452 B
C#
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;
|
|
}
|
|
});
|
|
}
|
|
} |