Property Declaration on WPF Only

Property Declaration on WPF Only

Old forum URL: forums.lhotka.net/forums/t/10921.aspx


st3fanus posted on Monday, November 28, 2011

Hi all,

 

I just want develop a small app on WPF only.

Am I right that :

If i just declare / define a property metadata use

private static .... NOT use public static readonly

???

because i think that I'm not stuck with silverlight limitation for serialization

 

thanks a lot

 

RockfordLhotka replied on Monday, November 28, 2011

The public vs private on the PropertyInfo declaration has to do with reflection limitations on Silverlight/WP7/WinRT - so it really doesn't directly impact serialization.

You are right that you can make those fields private when using full .NET.

However, I'd caution against that (I recommend making them public) because it is pretty clear that the future of .NET on the client is a sandboxed and restricted runtime where the Silverlight/WP7/WinRT limitations on reflection are normal and things like WPF/Windows Forms are the exception.

st3fanus replied on Monday, November 28, 2011

Hi Roc

 

Thanks for your quick response.. :)

I got your recommendation

thanks

Copyright (c) Marimer LLC