This project has moved and is read-only. For the latest updates, please go here.

DefaultStyleKeyProperty.OverrideMetadata in non-static constructor

Nov 18, 2010 at 5:24 AM


I've just downloaded the recent code for .Net 3.5 and seems there is a bug:

        public NumericUpDown()
            : base()
            DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown)));

so, I can't create more than one numeric up-down controls on a form. I expect it should be:

        static NumericUpDown()
            DefaultStyleKeyProperty.OverrideMetadata(typeof(NumericUpDown), new FrameworkPropertyMetadata(typeof(NumericUpDown)));

then it works ok.

Thanks for the library and the efforts to support, it's a very good supplement to the standard WPF controls.

Regards, Alex

Nov 18, 2010 at 2:28 PM

Yes, I am aware of the issue you reported.  It appears that I forgot to merge that fix into the 3.5 solution before the 1.2 release.  This has been fixed in the latest source code.  The is a release scheduled for Dec 2010 that will also include this bug fix.

Nov 18, 2010 at 2:48 PM

I actually just patched the binaries for the .NET 3.5 release 1.2.  If you were to download the new binaries it should work.  Thanks.