![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Getting ContentPropertyAttribute to work I've got a custom control that has a ContentProperty set to a public read-only collection property. However, when I try to build my app, it tells me: "Cannot set content property 'MyProp' on element 'MyClass'. 'MyProp' has incorrect access level or its assembly does not allow access" My class is defined as such: [ContentProperty("MyProp")] public class MyClass { private ICollection _MyProp; public ICollection MyProp { get {...} } } The documentation for the attribute doesn't mention any specific permissions required, and I don't really see how a public access modifier would be wrong. Anyone use this attribute and know where I'm erring? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Getting ContentPropertyAttribute to work Problem solved: Replace the interface return value with a class, like List<>. Not sure why that error comes up, though, since it should be a valid construct, as the property instantiates the value. "Keith Patrick" <richard_keith_patrick@nospam.hotmail.com> wrote in message news:Os4TqnoLHHA.140@TK2MSFTNGP04.phx.gbl... > I've got a custom control that has a ContentProperty set to a public > read-only collection property. However, when I try to build my app, it > tells me: > "Cannot set content property 'MyProp' on element 'MyClass'. 'MyProp' has > incorrect access level or its assembly does not allow access" > > My class is defined as such: > [ContentProperty("MyProp")] > public class MyClass { > private ICollection _MyProp; > public ICollection MyProp { get {...} } > } > > The documentation for the attribute doesn't mention any specific > permissions required, and I don't really see how a public access modifier > would be wrong. Anyone use this attribute and know where I'm erring? > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| speakers randomly wont work sometimes on laptop but external will sometime work | Sound & Audio | |||
| Still searching for way to get Vista search to work: Why doesn't FilterFilesWithUnknownExtensions registry key work in Vista? | Vista General | |||
| all cd's don't work, but dvd's still work | Vista hardware & devices | |||
| HP LaserJet 1010 don't work in Vista since Beta2 - Advanced 1384 Printing Support drivers for XP don't work | Vista print fax & scan | |||
| Will all the programs that work on xp work on vista? | Vista General | |||