Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic XamlParseExceptions (Read 10138 times)
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
XamlParseExceptions
Jan 26th, 2010 at 3:48pm
Print Post  
After adding a HeaderPosition property to ListViewSettings.CellSettings:
Code
Select All
<my:Calendar.ListViewSettings>
<my:ListViewSettings>
<my:ListViewSettings.CellSettings>
<my:CellSettings HeaderPosition="Bottom" />
</my:ListViewSettings.CellSettings>
</my:ListViewSettings>
</my:Calendar.ListViewSettings> 



I get:
Code
Select All
System.Windows.Markup.XamlParseException occurred
  Message="Cannot convert string 'Bottom' in attribute 'HeaderPosition' to object of type 'System.Nullable`1[[MindFusion.Scheduling.Wpf.Position, MindFusion.Scheduling.Wpf, Version=2.0.0.20315, Culture=neutral, PublicKeyToken=d12631580350466b]]'. Bottom is not a valid value for Nullable`1.  Error at object 'MindFusion.Scheduling.Wpf.CellSettings' in markup file 'Tutorial1;component/window1.xaml' Line 23 Position 24."
  Source="PresentationFramework"
  LineNumber=23
  LinePosition=24
  NameContext="CellSettings"
  StackTrace:
	 at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
	 at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
	 at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
	 at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
	 at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
	 at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
	 at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
	 at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
	 at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
	 at System.Windows.Markup.TreeBuilder.Parse()
	 at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
	 at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
	 at MindFusion.Scheduling.Wpf.Samples.CS.Tutorial1.Window1.InitializeComponent() in c:\Program Files (x86)\MindFusion\MindFusion.Scheduling for WPF (Trial Version)\VS2008 (.NET 3.0)\Samples\C#\Tutorials\Tutorial1\Window1.xaml:line 1
	 at MindFusion.Scheduling.Wpf.Samples.CS.Tutorial1.Window1..ctor() in C:\Program Files (x86)\MindFusion\MindFusion.Scheduling for WPF (Trial Version)\VS2008 (.NET 3.0)\Samples\C#\Tutorials\Tutorial1\Window1.xaml.cs:line 22
  InnerException: System.FormatException
	 Message="Bottom is not a valid value for Nullable`1."
	 Source="System"
	 StackTrace:
		at System.ComponentModel.EnumConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
		at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
		at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
	 InnerException: System.ArgumentException
		Message="Type provided must be an Enum.\r\nParameter name: enumType"
		Source="mscorlib"
		ParamName="enumType"
		StackTrace:
		     at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
		     at System.ComponentModel.EnumConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
		InnerException:  



And I have similar problems with projects using Visual Studio 2010: There all Theme="Vista" assignments in xaml get a similar exception about Nullables (I don't see nullables anywhere).

Is this some sort of obfuscation problem?
  

/\/\arkus.
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #1 - Jan 26th, 2010 at 3:48pm
Print Post  
The Theme property with VS2010: (last message would have been too long):

Code
Select All
System.Windows.Markup.XamlParseException occurred
  Message='Vista' string is not a valid value for 'Theme' property of type 'Nullable`1'. No parameterless constructor defined for this object.  Error at object 'calendar' in markup file 'MyProject;component/simpleweekviewdocwin.xaml' Line 40 Position 42.
  Source=PresentationFramework
  LineNumber=40
  LinePosition=42
  NameContext=calendar
  StackTrace:
	 at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
	 at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
	 at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
	 at System.Windows.Markup.BamlRecordReader.ThrowPropertyParseError(Exception e, String propertyName, String attribValue, Object element, Type propertyType)
	 at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
	 at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
	 at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
	 at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
	 at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
	 at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
	 at System.Windows.Markup.TreeBuilder.Parse()
	 at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
	 at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
	 at DotNetFabrik.MyProject.SimpleWeekViewDocWin.InitializeComponent() in c:\Entwicklung\svnWork\MyProject\SimpleWeekViewDocWin.xaml:line 1
	 at DotNetFabrik.MyProject.SimpleWeekViewDocWin..ctor() in C:\Entwicklung\svnWork\MyProject\SimpleWeekViewDocWin.xaml.cs:line 33
  InnerException: System.MissingMethodException
	 Message=No parameterless constructor defined for this object.
	 Source=mscorlib
	 StackTrace:
		at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
		at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
		at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
		at System.Activator.CreateInstance(Type type, Boolean nonPublic)
		at System.Windows.Markup.BamlMapTable.GetConverterFromId(Int16 typeId, Type propType, ParserContext pc)
		at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
		at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
	 InnerException:
 

  

/\/\arkus.
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #2 - Jan 26th, 2010 at 4:13pm
Print Post  
BTW:
The second problem with the Theme property only happens when compiling from within VS2010 or by using msbuild 4.0 -- using msbuild 3.5 (from VS2008 command prompt) against the VS2010 project (which uses .NET target framework 3.5) results in a working executable.
  

/\/\arkus.
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #3 - Jan 26th, 2010 at 4:25pm
Print Post  
I removed the Theme="Vista" property from xaml and a second later (while in VS2010 xaml editor) a messagebox popped up:

---------------------------

---------------------------
kofti bate...
---------------------------
OK   
---------------------------

???
  

/\/\arkus.
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #4 - Jan 27th, 2010 at 1:31pm
Print Post  
It's the DependencyProperties (static field Calendar.ThemeProperty) which are created wrong.

BTW: I think CurrentView and GroupType also should be dependency properties.
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: XamlParseExceptions
Reply #5 - Jan 27th, 2010 at 2:01pm
Print Post  
The ThemeProperty is registered as a Nullable<ThemeType> dependency property. It seems that VS 2010 has some problems with Nullable properties. We have converted all Nullable properties to normal properties now. A new version of the control can be downloaded from the following link:

https://mindfusion.eu/_pln_trial/MindFusion.Scheduling.Wpf.2.1.zip

This version also introduces customizable templates for view cells. Check this topic for more information on how to use them.

Regards,
Meppy
  
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #6 - Jan 28th, 2010 at 4:48pm
Print Post  
Great Smiley Now even Intellisense (ctrl+j) works for the Theme property in xaml view.

Note that the problem with HeaderPosition property of ListViewSettings.CellSettings even failed on VS2008 when being declared in xaml.
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: XamlParseExceptions
Reply #7 - Jan 29th, 2010 at 7:09am
Print Post  
Does HeaderPosition still crash with the new version?

Regards,
Meppy
  
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: XamlParseExceptions
Reply #8 - Jan 29th, 2010 at 9:37am
Print Post  
No. I only wanted to note that VS2008 users will benefit from the property changes, too.
  

/\/\arkus.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint