Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Getting ContentPropertyAttribute to work

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-02-2007   #1 (permalink)
Keith Patrick
Guest


 

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
Guest


 

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
Old 01-02-2007   #3 (permalink)
Keith Patrick
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Still searching for way to get Vista search to work: Why doesn't FilterFilesWithUnknownExtensions registry key work in Vista? Celegans Vista General 11 08-31-2007 09:04 AM
Some administrator work doesn't work Rem-8 Vista General 4 05-19-2007 07:08 AM
all cd's don't work, but dvd's still work Phil Vista hardware & devices 2 05-18-2007 09:35 AM
HP LaserJet 1010 don't work in Vista since Beta2 - Advanced 1384 Printing Support drivers for XP don't work Alexey Vista print fax & scan 2 10-18-2006 07:05 PM
Will all the programs that work on xp work on vista? exciter Vista General 14 10-06-2006 11:40 PM


Vistax64.com 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 2005-2008

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 47 48 49 50 51