Extensions.Controls.TabControl

Apr 17, 2012 at 10:10 AM

In the Extended Tabcontrol you delete the Code:

DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));

from the original. Why?

2 Problems.

1. With that line its not possible to add 2 Instances of that Control

2. Without that line I can not load all tab items on startup.

Coordinator
Apr 17, 2012 at 10:13 AM

It should have been in the static constructor. This is how it should work:

        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Windows.Controls.TabControl"/>.class.
        /// </summary>
        static TabControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));
        }

Apr 17, 2012 at 1:18 PM

Perfect Thanks.