Changing DocumentWindow style: Application cannot run

Docking/MDI for WPF Forum

Posted 4 years ago by Chris Carter
Version: 14.2.0610
Avatar

This question almost answered mine: http://www.actiprosoftware.com-www.actiprosoftware.com/community/thread/20330/changing-floating-documentwindow-style

This is what I want to do (although unfortunately I have no idea how to activate the code-highlighter):

<Style TargetType="{x:Type docking:DocumentWindow}">
	<Style.Triggers>
		<Trigger Property="IsMouseOver" Value="True">
			<Setter Property="TabBackground" Value="#038BE4" />
		</Trigger>
	</Style.Triggers>
</Style>

That gives me a runtime exception at the first line of my XAML, saying "Cannot have nested BeginInit calls on the same instance." I think this is thrown by System.Collections.ListDictionaryInternal.

Second and subsequent runs of the same code points to my opening Window.Resources tag, and says "Item has already been added. Key in dictionary: 'ActiproSoftware.Windows.Controls.Docking.DocumentWindow' Key being added: 'ActiproSoftware.Windows.Controls.Docking.DocumentWindow'." That's somehow related to both System.Collections.ListDictionaryInternal and System.Windows.ResourceDictionary.DeferrableContent.

Changing the code by so much as removing and adding the same tab character sends me back to the first error.

I reduced my code to this for testing purposes:

<Style TargetType="{x:Type docking:DocumentWindow}">
	<Setter Property="TabBackground" Value="#038BE4" />
</Style> 

That shows what I want to achieve in the designer but otherwise has exactly the same results.

What am I doing wrong? What is BeginInit and how is it relevant? And, for curiosity's sake, why am I apparently adding key-value pairs to a persistent dictionary?

Comments (1)

Posted 4 years ago by Chris Carter
Avatar

Apologies, I had a previous <Style TargetType="{x:Type docking:DocumentWindow}"> in the same Window.Resources element. Never mind!

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.