I've an image structured in this way:
<Image Height="32" Width="32" Source="{Binding MatchController.Match.TeamHomeShield}" IsEnabled="False" />
and a label:
<Label Content="{Binding MatchController.Match.TeamHomeShield}" />
my problem's that I can't get the image displayed on the Image, but on the label I can see the value of TeamHomeShield
, the property is created in this way:
private string _teamHomeShield;
public string TeamHomeShield
{
get { return _teamHomeShield; }
set
{
_teamHomeShield = value;
OnPropertyChanged();
}
}
private string _teamAwayShield;
public string TeamAwayShield
{
get { return _teamAwayShield; }
set
{
_teamAwayShield = value;
OnPropertyChanged();
}
}
why happen this?
You can use ImageSource property (not string) for binding images correctly.
For example:
Please check your Image source format "/YourAssemblyName;component/YourPath/YourImage with extension"
xaml:
xaml.cs: