Files
Ho Ngoc Hai 76d75c753b Migrate
2026-05-23 18:37:02 +07:00

34 lines
917 B
C#

namespace AppClientBase.Services;
/// <summary>
/// EN: Navigation service using Shell navigation.
/// VI: Dịch vụ điều hướng sử dụng Shell navigation.
/// </summary>
public class NavigationService : INavigationService
{
/// <summary>
/// EN: Navigate to a route with optional parameters.
/// VI: Điều hướng đến một route với các tham số tùy chọn.
/// </summary>
public async Task GoToAsync(string route, IDictionary<string, object>? parameters = null)
{
if (parameters != null)
{
await Shell.Current.GoToAsync(route, parameters);
}
else
{
await Shell.Current.GoToAsync(route);
}
}
/// <summary>
/// EN: Navigate back.
/// VI: Điều hướng quay lại.
/// </summary>
public async Task GoBackAsync()
{
await Shell.Current.GoToAsync("..");
}
}