I want to show a different icon/image depending on an enum value. For example, if I had the following enum:
public enum UploadStatus
{
Unknown = 0,
WaitingToUpload = 10,
Uploading = 20,
Uploaded = 30,
UploadFailed = 40
}
I'd like to write XAML that looks something like this:
...
<EnumImage Value="{Binding Path=CurrentStatus}">
<EnumImageItem Value="Unknown" Image="/images/unknown.png" />
<EnumImageItem Value="WaitingToUpload" Image="/images/clock.png" />
<EnumImageItem Value="Uploading" Image="/images/upload.png" />
<EnumImageItem Value="Uploaded" Image="/images/tick.png" />
<EnumImageItem Value="UploadFailed" Image="/images/error.png" />
</EnumImage>
...
I've found many posts suggesting custom IValueConverters, but those solutions don't fit the XAML paradigm.
Any pointers or suggestions?