I have an ImageCell as part of a ListView that is supposed to display three pieces of information obtained from the ViewModel for the page via data binding.
XAML:
<ListView x:Name="ScoreListView" ItemsSource="{Binding DBScores}" IsPullToRefreshEnabled="True" RefreshCommand="{Binding RefreshScoresAsyncCommand}" IsRefreshing="{Binding IsBusy, Mode=OneWay}"> <ListView.ItemTemplate> <DataTemplate> <ImageCell Text="{Binding DisplayName}" Detail="{Binding Points}" ImageSource="{Binding SyncImagePath}"/> </DataTemplate> </ListView.ItemTemplate> C#
DBScores = new ObservableCollection<ScoresTable>(); ...
var downloadedList = await App.AzureService.GetScores(); downloadedList = downloadedList.OrderByDescending(x => x.Points).ThenBy(x => x.DisplayName).ToList(); DBScores = new ObservableCollection<ScoresTable>(); foreach (ScoresTable element in downloadedList) { if(element.Synced == 0) { element.SyncImagePath = "notsynced.png"; } else { element.SyncImagePath = "synced.png"; } DBScores.Add(element); } ...
public class ScoresTable { [JsonProperty("Id")] public string Id { get; set; } public string DisplayName { get; set;} public int Points { get; set; } public DateTime AchievedOn { get; set; } public int Synced { get; set; } public string Latitude { get; set; } public string Longitude { get; set; } [JsonIgnore] public string SyncImagePath { get; set; } } The bindings for DisplayName and Points work just fine. I have the relevant images placed in my Android Project's Resources/drawable folder and have added them to the visual studio project. Their names are spelled correctly and have the correct case. When I load the images from the database I check their Synced property and set the image path to one of two images; synced.png or notsynced.png
I'm at a loss because this worked when I went home yesterday, and now it doesn't. I've tried cleaning in VS and manually deleting the bin and obj folders and rebuilding the project.
Edit 1; The Build Actions are set to AndroidResource
Edit 2; This is what I see