diff --git a/src/Gen3Hex.Core/ViewModels/SearchResultsViewPort.cs b/src/Gen3Hex.Core/ViewModels/SearchResultsViewPort.cs index 6360ab4c..4d661741 100644 --- a/src/Gen3Hex.Core/ViewModels/SearchResultsViewPort.cs +++ b/src/Gen3Hex.Core/ViewModels/SearchResultsViewPort.cs @@ -55,15 +55,15 @@ namespace HavenSoft.Gen3Hex.Core.ViewModels { } public string Name { get; } public string FileName => string.Empty; - public ICommand Save => null; - public ICommand SaveAs => null; - public ICommand Undo => null; - public ICommand Redo => null; - public ICommand Copy => null; - public ICommand Clear => null; - public ICommand Goto => null; - public ICommand Back => null; - public ICommand Forward => null; + public ICommand Save { get; } = new StubCommand(); + public ICommand SaveAs { get; } = new StubCommand(); + public ICommand Undo { get; } = new StubCommand(); + public ICommand Redo { get; } = new StubCommand(); + public ICommand Copy { get; } = new StubCommand(); + public ICommand Clear { get; } = new StubCommand(); + public ICommand Goto { get; } = new StubCommand(); + public ICommand Back { get; } = new StubCommand(); + public ICommand Forward { get; } = new StubCommand(); public ICommand Close => close; public IModel Model => null; diff --git a/src/Gen3Hex.Tests/NavigationTests.cs b/src/Gen3Hex.Tests/NavigationTests.cs index bfb492e9..7926718b 100644 --- a/src/Gen3Hex.Tests/NavigationTests.cs +++ b/src/Gen3Hex.Tests/NavigationTests.cs @@ -142,6 +142,13 @@ namespace HavenSoft.Gen3Hex.Tests { Assert.Equal("000A00", viewPort.Headers[0]); } + [Fact] + public void CannotBackFromSearchTab() { + var searchTab = new SearchResultsViewPort("bob"); + Assert.False(searchTab.Back.CanExecute(null)); + Assert.False(searchTab.Forward.CanExecute(null)); + } + [Fact] public void BackRecallsYourLastScrollPosition() { var viewPort = new ViewPort(new LoadedFile("test.txt", new byte[0x1000])) { Width = 0x10, Height = 0x10 };