-> note that I had to remove EditOnlyNotifiesCollectionChangeOnceWhenScrolling(),
that test is no longer true. Changes to pointers and anchors can change data
elsewhere on screen.
... This additionally requires that the FileName shares its oldValue when it changes.
- All TabContents are ViewModels
- ViewPort should notify when its FileName changes
an argument for closing tabs
- don't do threading work in collection change callbacks. Instead,
do thread switching as early as possible, as soon as I realize that work
needs to be done (in WindowsFileSystem).
- if ConsiderReload is called because of a file change and the file is now
missing, then do nothing.
- if ConsiderReload is called because the file got shorter, update the
Selection.
... because you can have the same file open in two tabs.
- Allow HexContent's ContentChanged to come from a background thread
... important for when the notification comes from a file change
- Allow MainWindow to track deferred work
- Allow Tabs to request delayed work
- Allow EditorViewModel to request delayed work
... because sometimes windows notifies about a file change before the
other application lets go of the file handle.
- IViewPort should actually expose its FileName
... EditorViewModel needs to know a ViewPort's file to setup / tear down
the file watch in IFileSystem
- Implement the reload in ViewPort
... note that the reload can fail if the file is still being edited.
if this happens, then ask the app to retry next time the user clicks.
- 2 more unit tests to capture the desired behavior of requesting delayed work.
first pass at implementing the windows version of the new interface methods
IViewPort now has a public method to call whenever you want to notify it that its underlying file has been changed.
Added 3 tests showing how the Editor and ViewPort should behave with this new functionality.
- Editor should hook up ViewPorts whenever a new tab is opened
- Editor should clear out ViewPorts whenever a tab is closed
- ViewPort should reload when the file is changed and it is not.
Note that the model isn't implemented yet. This is just some failing tests.
Pull out command implementations into helper.
Single-source the list of commands that need to be refreshed on tab change.
Refactor ViewPort constructor.
Pull out command implemenatations into helper.
Use CanAlwaysExecute instead of arg => true
Move CanAlwaysExecute to command extensions.
Change 'EditorNotifiesCanExecuteChangedOnTabChange' to a theory,
so I can more easily add new commands to test for in the future.
Bug fix: EditorViewModel should notify copy/delete commands when tab changes.
CompositeViewPort has correct headers
Find closes after run
CompositeViewPort can scroll now (max scroll is right, notifies work correctly)
Goto and Find Control Visibiilty notify change _after_ updating other control visibilities.
so the control you care about (the one you actively chose to show/hide) gets notified last.
this makes focus work as expected.
Double-clicking in a HexContent follows data links
currently used to open full data when find-tab is double-clicked
added lots of keyboard / menuitem stuff to MainWindow.xaml
This was needed so that a CompositeViewPort could follow links to the main view that created it.
Implemented CompositeViewPort
Implemented Find for the EditorViewModel
Implemented Find for the ViewPort
All tabs can now request that focus move from them to another tab, but they have to know that tab by reference.
All ViewPorts can now "follow link" at a chosen (x,y).
Added tests to show how the editor should behave for tab change requests.
add style for button
add error display in the main window, with commands for hiding it
add OnError to ITabContent so tabs can bubble errors up to the main viewmodel.
fix a UI bug where hiding the goto when there are no tabs caused a crash (see MainWindow.xaml.cs)
add tests showing that selection moves during a goto
add tests showing that tab errors are shown/cleared by the EditorViewModel.
-> 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.