Hi,
I want to create new tab dynamically in my viewModel with my own contextMenu for header. For this I create textBlock with mouseRightButtonDown event, and add it to documentWindow's header, then I add documentWindow to tabbedMdiContainer and bind it to my view.
Here is my XAMl :
<docking:TabbedMdiHost Content="{Binding MdiContainer}" IsCloseButtonOnTab="False" x:Name="AlTabbedMdiHost"/>
and code in viewModel:
var documentWindow = new DocumentWindow ();
var textBlock = new TextBlock { Text = "Text", Height = 15};
textBlock.MouseRightButtonDown += OnTxtBlckRightMouseDown;
documentWindow.Header = textBlock;
MdiContainer.Items.Add(documentWindow);
The problem is that the size of a textBlock doesn't fit headers size, so I have two contextMenus - one when I click on a header and another when I click on a textBlock.
How can I solve this problem?
Thnx in advance.