简体   繁体   中英

Partial class with portable class library

I have ported a class library to Portable Class Library, this Portable class library is shared between the server code, WPF applications and Silverlight, so far so good

Before porting I had a partial class in the Silverlight project to support custom properties only relevant in that application, but now I am unable to create partial class with properties.

If I do VS only picks up the properties defined in the partial class and not in the portable class.

So the question is: Is it possible to use Partial classes with Portable class library?

You cannot extend a class from a different assembly. Partial classes only work for multiple fragments of a single class in the assembly being built . It sounds like the class is now in a separate dll: you can't extend that via partial classes.

Maybe encapsulate the class instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM