I have a control that contains an image that is supposed to be pulled from a file location (either web or local). I have the following XAML code:
<Image Width="96" Height="96" Stretch="Uniform" Grid.Column="1"
Source="{Binding PreviewImageFullPath, FallbackValue={StaticResource img_Fallback}, TargetNullValue={StaticResource img_Fallback}}" />
and this is the img_Fallback that it refers to:
<BitmapImage UriSource="pack://application:,,,/GamutBase;component/Images/Icon_PreviewMissing.png" x:Key="img_Fallback" />
When the relevant property is a null or empty string it shows up just fine. And as expected if the property is set and the file exists the main image shows up. However when the property is set to a location that isn't found nothing shows up at all, neither the main image (obviously) or the fallback. How do you make the fallback show up in this case?