intvsteve / VINTage

Various Intellivision-related projects, including the LTO Flash! User Interface application.
GNU General Public License v2.0
3 stars 1 forks source link

Fix hard crash in WPF when dragging items to folder #344

Closed intvsteve closed 3 years ago

intvsteve commented 3 years ago

This fixes Issue #343

At issue is that the root of the file system is nearly full, which forbids dragging an item. However, the cart itself may not be full, so it's still possible to drag the file(s) to a sub-folder on the cart. When completing the drag, a necessary argument was set to null. This happened because the drag drop data that identifies the root menu layout ViewModel was never set.

The fix is simple - update that data during the drag once a valid drop target is hit.

There is an argument to be made that we could always set this data, or never even need to set it and always just assume based on other application state. Perhaps for another day. This fix dovetails neatly into existing code, and makes use of a return value that was previously ignored.

The odd code layout (not using an AND) is a sop to unit test / code coverage plans for the future.