Posts

Showing posts with the label uwp

How to change the image of listview item based on bind value - UWP

How to change the image of listview item based on bind value - UWP I have a listview which bind values using observable collection. listview contains a button with image and text. Based on the text value I want to change the background color of button and also need to change the source of image. How can I achieve this? <ListView ItemsSource="{x:Bind ShopArray}"> <ListView.ItemTemplate> <DataTemplate x:DataType="local:CurrentShopList2"> <Button Background="Green" > <Grid> <TextBlock Foreground="Black" FontWeight="Bold" Text="{x:Bind IsBooksAvailable}"/> <Image Source="/Assets/booksAvailable.png" Stretch="None" /> </Grid> </Button> </DataTemplate> </ListView.ItemTemplate> </ListView> If the value of IsBooksAvailable=...