bind to static property in app.xaml.cs for WP7
How can I bind to a static boolean property defined in App.xaml.cs in my wp7 page.xaml?
I have a static property - IsTrial (boolean) defined in App.xaml.cs and would like to bind to it to hide/show the AdControl from microsof开发者_运维技巧t.
Silverlight 3 (upon which the Windows Phone 7 framework is built) does not support the x:Static
markup extension, so you cannot bind to a static property. However, you can expose a "regular" read-only property that simply returns the value of the static property.
private static bool IsTrialCore
{
get { // Your logic here. }
}
public bool IsTrial
{
get { return IsTrailCore; }
}
精彩评论