Allow Bound ItemCollections to use the "+" button on the DocumentDock tab strip #899
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off thanks for this amazing library; I'm planning to use it for Kusto-Loco as soon as I get to grips with it :-)
Following through the documentation, my first move was to try to create simple DocumentDock. The documentation suggests this can be easily bound to an Observable Collection and this is indeed the case.. However, if this route is taken there's an unfortunate side-effect that the "+" button on the tab-strip doesn't actually create a new document.
The reason for this is that CreateNewDocument either:
This PR attempts to make it easier for users to add items from the + button.
Commit 1 in the PR
AddDocumentToBoundCollection()
to theIFactory
interfaceFactory
so that this is a no-op by defaultDocumentDock
so that it attempts this route before trying the other mechanisms to add a documentThere are a few other approaches that could be taken and might be better..
ICollectionManager
) on theDataContext
ICommand AddItem
property on theDataContext
I'd also be happy to change the naming
Commit 2 in the PR
Adds a working sample using this technique. The document collection is bound to an ObservableCollection and a DockFactory is used to add new documents when '+' is pressed.
Commit 3 in the PR
Some light edits to the documentation to cover a few missing steps I found while trying to follow along. One point of note is that the ViewLocator seems to be redundant if using the ItemCollection approach ?