|
Hi Guys, I am using a cut down version of SoapBox.Core wherein I am not using MEF but using the LayoutManager with the required interfaces to show the AvalonEdit text editor in an MVVM scenario. Now the problem I am getting is that the ContainsKey check in the LayoutManager.ShowDocument method doesnt seem to work and I seem to get duplicates each time I want a document to be shown. Can someone please tell me what I could be doing wrong. My DocumentViewModelBase inherits from TextEditor and implements IDocument & ILayoutItem |
|
Are you aware that the IDocument is more like a document factory? It's supposed to generate copies of itself, depending on the memento that gets passed along with it. Let's say the memento is just a file name. It should be checking for anything with the same file name, and just showing that one. If it can't find an existing document with the same filename, it then delegates to the IDocument to create a new document instance. The mementos indicate whether or not it should be a new instance or an existing one. |