Files
Toolkit2/Toolkit.Foundation/NavigationRegionProvider.cs
T
2024-05-09 22:37:36 +01:00

24 lines
563 B
C#

namespace Toolkit.Foundation;
public class NavigationRegionProvider(INavigationRegionCollection contexts) :
INavigationRegionProvider
{
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;
}
}
}