Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Create a control with a Children property?
4 replies. Latest Post by JFo on June 20, 2007.
(1)
JFo
Member
4 points
5 Posts
06-18-2007 7:13 PM |
I have created a SampleControl, and successfully got a Text property to work, but when I want to branch out to add children to my control, I'm running into parser errors.
System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream("SilverlightProject1.SampleControl.xaml");
}
<
</
And I get
---------------------------Microsoft Internet Explorer---------------------------
Silverlight error message ErrorCode: 2254ErrorType: ParserError Message: AG_E_PARSER_UNKNOWN_TYPE XamlFile: Page.xaml Line: 12 Position: 35
---------------------------OK ---------------------------
Where line 12 position 35 corresponds to <sample:SampleControl.Children>
forci
351 points
275 Posts
06-19-2007 2:42 AM |
When or if you get the answer, please post it here.
luisabreu
Participant
1676 points
612 Posts
06-19-2007 7:40 AM |
hello.
i believe that the parsing done on the current version is a bit limited. What i'm saying is that support for element property access is only supported for some elements (unlike wpf, where i think you can choose how your properties are represented in xaml).
nkramer
14 points
7 Posts
06-19-2007 10:06 PM |
You are correct, in Silverlight 1.1 the parser is extensible to a certain degree but not completely extensible, custom properties are okay as long as the property type is a built-in type and doesn't require a property element. Our current thinking is we'll enable the children scenario in a future CTP. Thanks.
06-20-2007 5:08 AM |
I've posted the closest workaround I could find (for now):
http://jfoscoding.blogspot.com/2007/06/hacking-in-items-property.html