Improvement to navigation regions

This commit is contained in:
TheXamlGuy
2024-05-09 22:37:36 +01:00
parent 711353c8e9
commit 54d2b5374d
31 changed files with 173 additions and 184 deletions
@@ -0,0 +1,24 @@
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;
}
}
}