Imagebutton change source property
问题 I'm developing a Windows Phone app. I have a custom button with an image inside. This is its XAML code: <ControlTemplate x:Key="ImageButton" TargetType="Button"> <Grid> <Image Margin="45,8,35,8" Source="Images/Delete.png"/> </Grid> </ControlTemplate> How can I change Image Source property programmatically? 回答1: To change the source of an image you need to make a new bitmap of your asset and set it as a souce BitmapImage myBitmapImage = new BitmapImage(new Uri("/Images/foo.png", UriKind