Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using CommandHandler.Commands;
|
||||
using CommandHandler.Navigation;
|
||||
|
||||
namespace CommandHandler;
|
||||
|
||||
internal class NavigationContext : INavigationContext
|
||||
{
|
||||
private INavigationState? _navigationState = null;
|
||||
|
||||
public void SetState(INavigationState navigationState)
|
||||
{
|
||||
_navigationState = navigationState;
|
||||
_navigationState.SetContext(this);
|
||||
}
|
||||
|
||||
public ICommand GetCommand(string message)
|
||||
{
|
||||
if (_navigationState == null)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
return _navigationState.GetCommand(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user