In my code I have a constant declared like this:
namespace Test.AppService
{
public static partial class Const
{
public static class Options
{
public const string PhraseVisible = "PV";
public const string MeaningVisible = "MV";
// Many more constants below here
I would like to access that in my XAML so I entered this:
<ContentPage
x:Class="Test.SettingsPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:app="clr-namespace:Test.AppService;assembly=Test">
<Label Text="{x:Static app:Const.Options.PracticePhraseVisible}" />
When I hover over it the IDE shows me that it recognizes app as being Test.AppService.Const
I'm really confused and don't know how I can set the text to the value of the constant. Can anyone give me advice on what to do?
Here's the error message I get for that line:
"Cannot resolve type "Const.Options". (XFC0000)