08-22-2014 10:31 AM
When Runtime Exceptions are enabled (Debug -> Exceptions...), several Numerics controls throw:
A first chance exception of type 'System.NotSupportedException' occurred in PresentationFramework.dll
Additional information: Cannot convert the value in attribute 'Property' to object of type 'System.Windows.DependencyProperty'.
No usable stacktrace or inner exception.
Microsoft Visual Studio Pro 2013 Update 3
Measurement Studio 2013 - 13.0.45.242
08-22-2014 03:38 PM
I was able to reproduce the first-chance exception you are seeing. It appears that if you use a TemplateBinding
with a converter, and do not specify the target type of the ControlTemplate
, then WPF will fail to resolve the property on the first attempt (causing the exception), but will still end up generating the correct binding.
I have created a task to update our control templates to correct this.
08-23-2014 11:01 AM - edited 08-23-2014 11:20 AM
There is a secondary exception being throw after the first one reported. If I remove the TankDouble control from my application, both exceptions no longer appear.
System.Xaml.XamlObjectWriterException occurred
_HResult=-2146233088
_message=Failed to create a 'DependencyProperty' from the text 'IsEnabled'.
HResult=-2146233088
IsTransient=false
Message=Failed to create a 'DependencyProperty' from the text 'IsEnabled'.
Source=System.Xaml
LineNumber=0
LinePosition=0
StackTrace:
at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
InnerException: System.NotSupportedException
_HResult=-2146233067
_message=Cannot convert the value in attribute 'Property' to object of type 'System.Windows.DependencyProperty'.
HResult=-2146233067
IsTransient=false
Message=Cannot convert the value in attribute 'Property' to object of type 'System.Windows.DependencyProperty'.
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.DependencyPropertyConverter.ResolveProperty(IServiceProvider serviceProvider, String targetName, Object source)
at System.Windows.Markup.DependencyPropertyConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object source)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
InnerException:
Followed by:
System.NullReferenceException occurred
_HResult=-2147467261
_message=Object reference not set to an instance of an object.
HResult=-2147467261
IsTransient=false
Message=Object reference not set to an instance of an object.
Source=System.Xaml
StackTrace:
at MS.Internal.Xaml.Context.ObjectWriterContext.GetDestinationType()
InnerException:
08-24-2014 10:30 AM
The XamlObjectWriterException
is for the same template-bound property that caused the NotSupportedException
exception.
Unfortunately, the NullReferenceException
is due to a bug in Microsoft's implementation of IDestinationTypeProvider
, which we use when parsing range values. I have created a separate task to see if we can avoid this error when the range value includes the target type.
08-11-2015 01:10 PM
Just wanted to let you know these issues have been fixed in the Measurement Studio 2015 release.