I am trying to set an element property using a DataTrigger in style.
<Image x:Name="post_image1" Height="278" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding LatestFeed[1].PostImageURL}" MaxWidth="410" MaxHeight="410" Margin="0,0,50,0"> <Image.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding post_image1.Source}" Value="noimage"> <Setter Property="Image.Visibility" Value="Collapsed" /> </DataTrigger> </Style.Triggers> </Style> </Image.Style> </Image>
I want that if the Source Value parameter is set to noimage (which I set as part of my data object), the Image Visibility property is set to Collapsed.
I think I'm close, and I'm not sure what I am missing.
wpf xaml
discorax
source share