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

asked 01 Nov '10, 13:13

tribal's gravatar image

accept rate: 0%

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.


answered 01 Nov '10, 18:26

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 01 Nov '10, 13:13

Seen: 1,786 times

Last updated: 01 Nov '10, 18:26

powered by OSQA