AmmyUI
AmmyUI copied to clipboard
Unable to set source attribute on image to Static Property
I have tried to set the property of source using following:
Image {
Source: Data.MySource
}
But that threw error saying Unresolved Reference. I did manage to work around it via....
Image {
Source: bind set [
Source: Data.MySource
]
}
Not sure if this is intentional or not?
Setting TextBlock text worked fine though..... TextBlock { Text: Data.MySource }
Can you try using fully-qualified name for the Data object? Something like this:
Image {
Source: MyApp.Data.MySource
}
Also, what are the types of Data and MySource?
Have tried full name. Here is the class its referring to:
namespace TestAPP.ViewModel
{
public class Data1
{
public const string MySource= "TestText";
}
}
As I say, this works:
TextBlock {
Text: Data1.MySource
}
But this doesnt
Image {
Source: Data1.MySource
}