I am working on a Windows Store App and trying to bind some XAML elements to a custom class:
namespace My.Name.Space {
public class AppSettings {
private static AppSettings _instance = new AppSettings();
public AppSettings Settings { get { return _instance; }
private static bool SomeOption {
get {
...
return option;
}
}
}
}
<!-- ResourceDict will be merged to the Application.Resources -->
<ResourceDictionary
...
xmlns:myNS="clr-namespace:My.Name.Space">
<myNS:AppSettings x:Key="AppSettings"/>
</ResourceDictionary>
<Button IsEnabled="{Binding Path=Settings.SomeOption, Source={StaticResource AppSettings} .../>
This works without any problem in a Windows Phone 8 App. But when trying to compile the same code in a Windows Store App the compiler says:
Unknown Type "AppSettings" in XML-Namespace "clr-namespace:My.Name.Space;assembly=MyAppProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
So, what can I do to bind a XAML element to my Settings class?