From ae4c73efc6234ef69d885f09190e2a8a7d95ae6b Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Tue, 6 Nov 2018 21:43:01 -0600 Subject: [PATCH 1/5] + change out app.xaml to use dynamicresource instead of directly using solarized:Theme. -> allows us to change styles at will + Add style for TextBlock / TextBox + Add handler in App.xaml.cs to update styles when the theme changes + Change HexContent's constants from ints to doubles so we can use them in Xaml. + MainWindow: add shortcuts/menuitems for Goto, Back, and Forward. + MainWindow: add control for Goto + MainWindow: add control/logic for toggling the Theme + MainWindow: add control to show addresses + EditorViewModel: add commands for back, forward, goto, and showGoto -> UI shortcut for Goto can't just immediately do a Goto: more info is needed. so instead, the first UI command just shows the box (and moves the focus) and a second command performs the action. + ScrollRegion: implement Goto/Back/Forward + ScrollRegion: own the logic for updating the address headers This is the initial push for the goto feature. There are bugs / needs more tests. --- Gen3Hex/View/App.xaml | 96 +++++++++++------- Gen3Hex/View/App.xaml.cs | 20 ++++ Gen3Hex/View/HexContent.cs | 8 +- Gen3Hex/View/MainWindow.xaml | 129 ++++++++++++++++-------- Gen3Hex/View/MainWindow.xaml.cs | 14 +++ Gen3Hex/ViewModel/EditorViewModel.cs | 29 +++++- Gen3Hex/ViewModel/ITabContent.cs | 3 + Gen3Hex/ViewModel/ScrollRegion.cs | 80 +++++++++++++-- Gen3Hex/ViewModel/ViewPort.cs | 5 + HavenSoft/Solarized.cs | 19 +++- HexTests/HexTests.csproj | 1 + HexTests/NavigationTests.cs | 144 +++++++++++++++++++++++++++ HexTests/ViewPortScrollTests.cs | 4 + 13 files changed, 456 insertions(+), 96 deletions(-) create mode 100644 HexTests/NavigationTests.cs diff --git a/Gen3Hex/View/App.xaml b/Gen3Hex/View/App.xaml index 9bc6e552..10d68147 100644 --- a/Gen3Hex/View/App.xaml +++ b/Gen3Hex/View/App.xaml @@ -8,21 +8,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + + + + + + - - + + + diff --git a/Gen3Hex/View/MainWindow.xaml b/Gen3Hex/View/MainWindow.xaml index 9bb9b5f5..c23e7424 100644 --- a/Gen3Hex/View/MainWindow.xaml +++ b/Gen3Hex/View/MainWindow.xaml @@ -4,6 +4,7 @@ xmlns:hsg3hv="clr-namespace:HavenSoft.Gen3Hex.View" xmlns:hsv="clr-namespace:HavenSoft.View;assembly=HavenSoft" xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:solarized="clr-namespace:Solarized;assembly=HavenSoft" Icon="..\Snorlax.ico" Title="Gen3Hex" Height="450" Width="800" AllowDrop="True" Background="{DynamicResource Background}"> @@ -19,6 +20,7 @@ + true @@ -47,6 +49,12 @@ + + + + @@ -92,8 +100,9 @@ - - + + + diff --git a/Gen3Hex/View/MainWindow.xaml.cs b/Gen3Hex/View/MainWindow.xaml.cs index 97552d05..17d44e0a 100644 --- a/Gen3Hex/View/MainWindow.xaml.cs +++ b/Gen3Hex/View/MainWindow.xaml.cs @@ -107,6 +107,7 @@ namespace HavenSoft.Gen3Hex.View { GotoBox.SelectAll(); Keyboard.Focus(GotoBox); } else { + if (ViewModel.SelectedIndex == -1) return; var selectedElement = (HexContent)GetChild(Tabs, "HexContent", ViewModel[ViewModel.SelectedIndex]); Keyboard.Focus(selectedElement); } diff --git a/Gen3Hex/ViewModel/EditorViewModel.cs b/Gen3Hex/ViewModel/EditorViewModel.cs index 1cc1bc92..4b3e7c35 100644 --- a/Gen3Hex/ViewModel/EditorViewModel.cs +++ b/Gen3Hex/ViewModel/EditorViewModel.cs @@ -11,11 +11,9 @@ namespace HavenSoft.Gen3Hex.ViewModel { private readonly IFileSystem fileSystem; private readonly List tabs; - private readonly StubCommand newCommand, open, save, saveAs, saveAll, close, closeAll, undo, redo, back, forward, gotoCommand, showGoto; + private readonly StubCommand newCommand, open, save, saveAs, saveAll, close, closeAll, undo, redo, back, forward, gotoCommand, showGoto, clearError; private readonly Dictionary, EventHandler> forwardExecuteChangeNotifications; - private int selectedIndex; - public ICommand New => newCommand; public ICommand Open => open; public ICommand Save => save; @@ -29,11 +27,31 @@ namespace HavenSoft.Gen3Hex.ViewModel { public ICommand Forward => forward; public ICommand Goto => gotoCommand; public ICommand ShowGoto => showGoto; + public ICommand ClearError => clearError; private bool gotoControlVisible; public bool GotoControlVisible { get => gotoControlVisible; - set => TryUpdate(ref gotoControlVisible, value); + private set { + TryUpdate(ref gotoControlVisible, value); + if (value) ClearError.Execute(); + } + } + + private bool showError; + public bool ShowError { + get => showError; + private set { + if (TryUpdate(ref showError, value)) clearError.CanExecuteChanged.Invoke(clearError, EventArgs.Empty); + } + } + + private string errorMessage; + public string ErrorMessage { + get => errorMessage; + private set { + if (TryUpdate(ref errorMessage, value)) ShowError = !string.IsNullOrEmpty(ErrorMessage); + } } #region Collection Properties @@ -44,6 +62,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { public int Count => tabs.Count; + private int selectedIndex; public int SelectedIndex { get => selectedIndex; set { @@ -87,6 +106,10 @@ namespace HavenSoft.Gen3Hex.ViewModel { CanExecute = CanAlwaysExecute, Execute = arg => GotoControlVisible = (bool)arg, }; + clearError = new StubCommand { + CanExecute = arg => showError, + Execute = arg => ErrorMessage = string.Empty, + }; save = CreateWrapperForSelected(tab => tab.Save); saveAs = CreateWrapperForSelected(tab => tab.SaveAs); saveAll = CreateWrapperForAll(tab => tab.Save); @@ -113,6 +136,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { SelectedIndex = tabs.Count - 1; CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, content)); content.Closed += RemoveTab; + content.OnError += AcceptError; if (content.Save != null) content.Save.CanExecuteChanged += RaiseSaveAllCanExecuteChanged; } @@ -188,9 +212,12 @@ namespace HavenSoft.Gen3Hex.ViewModel { tabs.Remove(tab); tab.Closed -= RemoveTab; + tab.OnError -= AcceptError; CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, tab, index)); } + private void AcceptError(object sender, string message) => ErrorMessage = message; + private void StartListeningToCommandsFromCurrentTab() { var commandsToRefresh = new List { undo, diff --git a/Gen3Hex/ViewModel/ITabContent.cs b/Gen3Hex/ViewModel/ITabContent.cs index 0bf66bf8..c84eadca 100644 --- a/Gen3Hex/ViewModel/ITabContent.cs +++ b/Gen3Hex/ViewModel/ITabContent.cs @@ -16,6 +16,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { ICommand Forward { get; } ICommand Close { get; } + event EventHandler OnError; event EventHandler Closed; } } diff --git a/Gen3Hex/ViewModel/ScrollRegion.cs b/Gen3Hex/ViewModel/ScrollRegion.cs index 5c354535..9d3b56de 100644 --- a/Gen3Hex/ViewModel/ScrollRegion.cs +++ b/Gen3Hex/ViewModel/ScrollRegion.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Globalization; using System.Windows.Input; namespace HavenSoft.Gen3Hex.ViewModel { @@ -14,26 +13,19 @@ namespace HavenSoft.Gen3Hex.ViewModel { { Direction.Right, new Point( 1, 0) }, }; - private readonly StubCommand scroll, gotoCommand, back, forward; - - // these back/forward stacks are not incapsulated in a history object because we want to be able to change a remembered address each time we visit it. - // if we navigate back, then scroll, then navigate forward, we want to remember the scroll if we go back again. - private readonly Stack backStack = new Stack(), forwardStack = new Stack(); + private readonly StubCommand scroll; private int dataIndex, width, height, scrollValue, maximumScroll, dataLength; public ICommand Scroll => scroll; - public ICommand Goto => gotoCommand; - public ICommand Back => back; - public ICommand Forward => forward; public int DataIndex { get => dataIndex; - private set { + set { var dif = value - dataIndex; if (TryUpdate(ref dataIndex, value)) { ScrollChanged?.Invoke(this, dif); - UpdateHeaders(); + UpdateScrollRange(); } } } @@ -93,32 +85,6 @@ namespace HavenSoft.Gen3Hex.ViewModel { CanExecute = args => dataLength > 0, Execute = args => ScrollExecuted((Direction)args), }; - gotoCommand = new StubCommand { - CanExecute = args => true, - Execute = args => { - if (int.TryParse(args.ToString(), NumberStyles.HexNumber, CultureInfo.CurrentCulture, out int result)) { - backStack.Push(DataIndex); - forwardStack.Clear(); - DataIndex = result; - } - }, - }; - back = new StubCommand { - CanExecute = args => backStack.Count > 0, - Execute = args => { - if (backStack.Count == 0) return; - forwardStack.Push(DataIndex); - DataIndex = backStack.Pop(); - }, - }; - forward = new StubCommand { - CanExecute = args => forwardStack.Count > 0, - Execute = args => { - if (forwardStack.Count == 0) return; - backStack.Push(DataIndex); - DataIndex = forwardStack.Pop(); - }, - }; UpdateHeaders(); } diff --git a/Gen3Hex/ViewModel/Selection.cs b/Gen3Hex/ViewModel/Selection.cs index ecb07478..28ca3b23 100644 --- a/Gen3Hex/ViewModel/Selection.cs +++ b/Gen3Hex/ViewModel/Selection.cs @@ -1,6 +1,8 @@ using HavenSoft.Gen3Hex.Model; using System; +using System.Collections.Generic; using System.ComponentModel; +using System.Globalization; using System.Runtime.CompilerServices; using System.Windows.Input; @@ -9,10 +11,17 @@ namespace HavenSoft.Gen3Hex.ViewModel { private readonly StubCommand moveSelectionStart = new StubCommand(), - moveSelectionEnd = new StubCommand(); + moveSelectionEnd = new StubCommand(), + gotoCommand = new StubCommand(), + forward = new StubCommand(), + backward = new StubCommand(); private readonly ScrollRegion scroll; + // these back/forward stacks are not incapsulated in a history object because we want to be able to change a remembered address each time we visit it. + // if we navigate back, then scroll, then navigate forward, we want to remember the scroll if we go back again. + private readonly Stack backStack = new Stack(), forwardStack = new Stack(); + private Point selectionStart, selectionEnd; public Point SelectionStart { @@ -45,8 +54,12 @@ namespace HavenSoft.Gen3Hex.ViewModel { } public ICommand MoveSelectionStart => moveSelectionStart; - public ICommand MoveSelectionEnd => moveSelectionEnd; + public ICommand Goto => gotoCommand; + public ICommand Forward => forward; + public ICommand Back => backward; + + public event EventHandler OnError; /// /// The owner may have something special going on with the selected point. @@ -62,6 +75,40 @@ namespace HavenSoft.Gen3Hex.ViewModel { moveSelectionStart.Execute = args => MoveSelectionStartExecuted((Direction)args); moveSelectionEnd.CanExecute = args => true; moveSelectionEnd.Execute = args => MoveSelectionEndExecuted((Direction)args); + + gotoCommand = new StubCommand { + CanExecute = args => true, + Execute = args => { + var address = args.ToString(); + if (int.TryParse(address, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out int result)) { + backStack.Push(scroll.DataIndex); + forwardStack.Clear(); + scroll.DataIndex = result; + SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + } else { + OnError?.Invoke(this, $"Unable to goto address '{address}'"); + } + }, + }; + backward = new StubCommand { + CanExecute = args => backStack.Count > 0, + Execute = args => { + if (backStack.Count == 0) return; + forwardStack.Push(scroll.DataIndex); + scroll.DataIndex = backStack.Pop(); + SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + }, + }; + forward = new StubCommand { + CanExecute = args => forwardStack.Count > 0, + Execute = args => { + if (forwardStack.Count == 0) return; + backStack.Push(scroll.DataIndex); + scroll.DataIndex = forwardStack.Pop(); + SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + }, + }; + } public bool IsSelected(Point point) { diff --git a/Gen3Hex/ViewModel/ViewPort.cs b/Gen3Hex/ViewModel/ViewPort.cs index 7b74a84b..019475b9 100644 --- a/Gen3Hex/ViewModel/ViewPort.cs +++ b/Gen3Hex/ViewModel/ViewPort.cs @@ -55,9 +55,9 @@ namespace HavenSoft.Gen3Hex.ViewModel { public ObservableCollection Headers => scroll.Headers; public ICommand Scroll => scroll.Scroll; - public ICommand Goto => scroll.Goto; - public ICommand Back => scroll.Back; - public ICommand Forward => scroll.Forward; + public ICommand Goto => selection.Goto; + public ICommand Back => selection.Back; + public ICommand Forward => selection.Forward; private void ScrollPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(scroll.DataIndex)) { @@ -193,6 +193,8 @@ namespace HavenSoft.Gen3Hex.ViewModel { } } + public event EventHandler OnError; + public event NotifyCollectionChangedEventHandler CollectionChanged; public ViewPort() : this(new LoadedFile(string.Empty, new byte[0])) { } @@ -207,6 +209,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { selection = new Selection(scroll); selection.PropertyChanged += SelectionPropertyChanged; selection.PreviewSelectionStartChanged += ClearActiveEditBeforeSelectionChanges; + selection.OnError += (sender, e) => OnError?.Invoke(this, e); history = new ChangeHistory>(RevertChanges); history.PropertyChanged += HistoryPropertyChanged; diff --git a/HexTests/GeneralAppTests.cs b/HexTests/GeneralAppTests.cs index 2b24321f..ac50e8ec 100644 --- a/HexTests/GeneralAppTests.cs +++ b/HexTests/GeneralAppTests.cs @@ -251,6 +251,47 @@ namespace HavenSoft.HexTests { Assert.Equal(1, count); } + [Fact] + public void EditorShowsErrors() { + var tab = new StubTabContent(); + editor.Add(tab); + var clearErrorChangedNotifications = 0; + editor.ClearError.CanExecuteChanged += (sender, e) => clearErrorChangedNotifications += 1; + + tab.OnError.Invoke(tab, "Some Message"); + + Assert.True(editor.ShowError); + Assert.Equal(editor.ErrorMessage, "Some Message"); + Assert.Equal(1, clearErrorChangedNotifications); + } + + [Fact] + public void EditorCanClearErrors() { + var tab = new StubTabContent(); + editor.Add(tab); + var clearErrorChangedNotifications = 0; + editor.ClearError.CanExecuteChanged += (sender, e) => clearErrorChangedNotifications += 1; + + tab.OnError.Invoke(tab, "Some Message"); + editor.ClearError.Execute(); + + Assert.False(editor.ShowError); + Assert.Equal(editor.ErrorMessage, string.Empty); + Assert.Equal(2, clearErrorChangedNotifications); + } + + [Fact] + public void ShowingGotoClearsErrors() { + var tab = new StubTabContent(); + editor.Add(tab); + + tab.OnError.Invoke(tab, "Some Message"); + editor.ShowGoto.Execute(); + + Assert.True(editor.GotoControlVisible); + Assert.False(editor.ShowError); + } + private StubTabContent CreateClosableTab() { var tab = new StubTabContent(); var close = new StubCommand { CanExecute = arg => true }; diff --git a/HexTests/NavigationTests.cs b/HexTests/NavigationTests.cs index d8cf59ef..1000fe15 100644 --- a/HexTests/NavigationTests.cs +++ b/HexTests/NavigationTests.cs @@ -140,5 +140,34 @@ namespace HavenSoft.HexTests { viewPort.Forward.Execute(); Assert.Equal("000A10", viewPort.Headers[0]); } + + [Fact] + public void GotoMovesScroll() { + var viewPort = new ViewPort(new LoadedFile("test.txt", new byte[0x1000])) { Width = 0x10, Height = 0x10 }; + + viewPort.Goto.Execute("000A00"); + + Assert.NotEqual(0, viewPort.ScrollValue); + } + + [Fact] + public void GotoErrorsOnBadAddress() { + var viewPort = new ViewPort(new LoadedFile("test.txt", new byte[0x1000])) { Width = 0x10, Height = 0x10 }; + int errorCount = 0; + viewPort.OnError += (sender, e) => errorCount += 1; + + viewPort.Goto.Execute("BadAddress"); + + Assert.Equal(1, errorCount); + } + + [Fact] + public void GotoMovesSelection() { + var viewPort = new ViewPort(new LoadedFile("test.txt", new byte[0x1000])) { Width = 0x10, Height = 0x10 }; + + viewPort.Goto.Execute("000C00"); + + Assert.Equal(new Point(0, 0), viewPort.SelectionStart); + } } } From c57953c5cfeb9bbab12c1c790c6c0f74e2f2f100 Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Thu, 8 Nov 2018 20:38:41 -0600 Subject: [PATCH 3/5] fixing broken test (the test was wrong). Changing the implementation of Selection so that ScrollRegion.DataIndex doesn't need a public set. --- Gen3Hex/ViewModel/ScrollRegion.cs | 2 +- Gen3Hex/ViewModel/Selection.cs | 12 ++++++------ HexTests/GeneralAppTests.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gen3Hex/ViewModel/ScrollRegion.cs b/Gen3Hex/ViewModel/ScrollRegion.cs index 9d3b56de..c2e33904 100644 --- a/Gen3Hex/ViewModel/ScrollRegion.cs +++ b/Gen3Hex/ViewModel/ScrollRegion.cs @@ -21,7 +21,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { public int DataIndex { get => dataIndex; - set { + private set { var dif = value - dataIndex; if (TryUpdate(ref dataIndex, value)) { ScrollChanged?.Invoke(this, dif); diff --git a/Gen3Hex/ViewModel/Selection.cs b/Gen3Hex/ViewModel/Selection.cs index 28ca3b23..d6f56e23 100644 --- a/Gen3Hex/ViewModel/Selection.cs +++ b/Gen3Hex/ViewModel/Selection.cs @@ -83,8 +83,8 @@ namespace HavenSoft.Gen3Hex.ViewModel { if (int.TryParse(address, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out int result)) { backStack.Push(scroll.DataIndex); forwardStack.Clear(); - scroll.DataIndex = result; - SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + SelectionStart = scroll.DataIndexToViewPoint(result); + scroll.ScrollValue += selectionStart.Y; } else { OnError?.Invoke(this, $"Unable to goto address '{address}'"); } @@ -95,8 +95,8 @@ namespace HavenSoft.Gen3Hex.ViewModel { Execute = args => { if (backStack.Count == 0) return; forwardStack.Push(scroll.DataIndex); - scroll.DataIndex = backStack.Pop(); - SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + SelectionStart = scroll.DataIndexToViewPoint(backStack.Pop()); + scroll.ScrollValue += selectionStart.Y; }, }; forward = new StubCommand { @@ -104,8 +104,8 @@ namespace HavenSoft.Gen3Hex.ViewModel { Execute = args => { if (forwardStack.Count == 0) return; backStack.Push(scroll.DataIndex); - scroll.DataIndex = forwardStack.Pop(); - SelectionStart = scroll.DataIndexToViewPoint(scroll.DataIndex); + SelectionStart = scroll.DataIndexToViewPoint(forwardStack.Pop()); + scroll.ScrollValue += selectionStart.Y; }, }; diff --git a/HexTests/GeneralAppTests.cs b/HexTests/GeneralAppTests.cs index ac50e8ec..8a3902c1 100644 --- a/HexTests/GeneralAppTests.cs +++ b/HexTests/GeneralAppTests.cs @@ -286,7 +286,7 @@ namespace HavenSoft.HexTests { editor.Add(tab); tab.OnError.Invoke(tab, "Some Message"); - editor.ShowGoto.Execute(); + editor.ShowGoto.Execute(true); Assert.True(editor.GotoControlVisible); Assert.False(editor.ShowError); From 042a589a9792177d550f1ce05d2bee9acf650e1d Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Thu, 8 Nov 2018 20:51:02 -0600 Subject: [PATCH 4/5] fix typo, remove duplicate code. --- Gen3Hex/ViewModel/ScrollRegion.cs | 7 +------ Gen3Hex/ViewModel/Selection.cs | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Gen3Hex/ViewModel/ScrollRegion.cs b/Gen3Hex/ViewModel/ScrollRegion.cs index c2e33904..cd3c5e29 100644 --- a/Gen3Hex/ViewModel/ScrollRegion.cs +++ b/Gen3Hex/ViewModel/ScrollRegion.cs @@ -128,12 +128,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { if (dif.Y != 0) { ScrollValue += dif.Y; } else { - var newDataIndex = (dataIndex + dif.X).LimitToRange(1 - width, dataLength - 1); - var scrollDif = newDataIndex - dataIndex; - if (TryUpdate(ref dataIndex, newDataIndex, nameof(DataIndex))) { - ScrollChanged?.Invoke(this, scrollDif); - UpdateScrollRange(); - } + DataIndex = (dataIndex + dif.X).LimitToRange(1 - width, dataLength - 1); } } diff --git a/Gen3Hex/ViewModel/Selection.cs b/Gen3Hex/ViewModel/Selection.cs index d6f56e23..3b4b746c 100644 --- a/Gen3Hex/ViewModel/Selection.cs +++ b/Gen3Hex/ViewModel/Selection.cs @@ -18,7 +18,7 @@ namespace HavenSoft.Gen3Hex.ViewModel { private readonly ScrollRegion scroll; - // these back/forward stacks are not incapsulated in a history object because we want to be able to change a remembered address each time we visit it. + // these back/forward stacks are not encapsulated in a history object because we want to be able to change a remembered address each time we visit it. // if we navigate back, then scroll, then navigate forward, we want to remember the scroll if we go back again. private readonly Stack backStack = new Stack(), forwardStack = new Stack(); From 67154009df27b80b6d280ecc14b0d2699b88c082 Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Sat, 10 Nov 2018 21:51:13 -0600 Subject: [PATCH 5/5] fix visual styles to correctly toggle between dark/light. cleanup on Button style --- Gen3Hex/View/App.xaml | 96 ++++++++++++++++++---------------------- Gen3Hex/View/App.xaml.cs | 6 +-- 2 files changed, 43 insertions(+), 59 deletions(-) diff --git a/Gen3Hex/View/App.xaml b/Gen3Hex/View/App.xaml index 68eb4d95..9375cfe3 100644 --- a/Gen3Hex/View/App.xaml +++ b/Gen3Hex/View/App.xaml @@ -12,10 +12,15 @@ + - + @@ -29,21 +34,6 @@ - - - - - - - - - - - - - - - - @@ -365,6 +354,7 @@ + @@ -377,14 +367,12 @@ - - diff --git a/Gen3Hex/View/App.xaml.cs b/Gen3Hex/View/App.xaml.cs index 36c56d1b..01126b11 100644 --- a/Gen3Hex/View/App.xaml.cs +++ b/Gen3Hex/View/App.xaml.cs @@ -1,5 +1,6 @@ using HavenSoft.Gen3Hex.Model; using HavenSoft.Gen3Hex.ViewModel; +using System.Collections.Generic; using System.IO; using System.Reflection; using System.Windows; @@ -26,11 +27,6 @@ namespace HavenSoft.Gen3Hex.View { { "Secondary", Solarized.Theme.Secondary }, { "Background", Solarized.Theme.Background }, { "Backlight", Solarized.Theme.Backlight }, - { "EmphasisColor", Solarized.Theme.Emphasis.Color }, - { "PrimaryColor", Solarized.Theme.Primary.Color }, - { "SecondaryColor", Solarized.Theme.Secondary.Color }, - { "BackgroundColor", Solarized.Theme.Background.Color }, - { "BacklightColor", Solarized.Theme.Backlight.Color }, }; Resources.MergedDictionaries.Clear(); Resources.MergedDictionaries.Add(dict);