Files
Toolkit2/Toolkit.Foundation/NavigationContextProvider.cs
T
TheXamlGuy bc55c4649b tidy
2024-04-26 23:05:36 +01:00

24 lines
566 B
C#

namespace Toolkit.Foundation;
public class NavigationContextProvider(INavigationContextCollection contexts) :
INavigationContextProvider
{
public object? Get(object key) =>
contexts.TryGetValue(key, out object? target) ? target : default;
public bool TryGet(object name,
out object? value)
{
if (contexts.TryGetValue(name,
out object? target))
{
value = target;
return true;
}
else
{
value = null;
return false;
}
}
}