I have an Image control. When the image is clicked at runtime it should be added to a grid as a child. I have implemented this.
My requirement now is when the image (which is now inside a grid) is tapped I need a border around the image. How can I achieve this?
I have added the following code inside image tapped but cannot see the border
Border b = new Border();
b.BorderThickness = new Thickness(4);
img1 = new Image();
img1.MaxHeight = 300;
img1.MaxWidth = 500;
b.Child = img1;
img1.Source = new BitmapImage((new Uri(imgPath, UriKind.RelativeOrAbsolute)));
grid1.Children.Add(b);