I'm using binding for source of an Image
control.
<Image Source="{Binding ImageUri}"/>
But this ImageUri
can be null, therefor I want to use a default image, a place holder, for that, which can be in /Assets/PlaceHolder.png
for example.
How can I set a default image? thanks. (It's a WP8 app, but should not be different of WPF)
You can achieve it by setting TargetNullValue
<Image>
<Image.Source>
<Binding Path="ImageUri" >
<Binding.TargetNullValue>
<ImageSource>/Assets/PlaceHolder.png</ImageSource>
</Binding.TargetNullValue>
</Binding>
</Image.Source>
</Image>