Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Getting ContentPropertyAttribute to work

 
 
Old 01-02-2007   #1 (permalink)
Keith Patrick


 
 

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 SpecsSystem Spec
Old 01-02-2007   #2 (permalink)
Keith Patrick


 
 

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 SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46