Attach Image/ImageBrush from code behind
问题 I'm trying to add an Image as the background of a UserControl. Depending on the value of a variable I need to change that background but whatever the path or Uri format I use, the background does not change. I've seen lots of questions here in stackoverflow but none fixes my single problem. I let the code below: if (callback.liveUvis.ContainsUVI(uvi)) { this.Status.Text = "LIVE"; ImageBrush imgB = new ImageBrush(); BitmapImage btpImg = new BitmapImage(); btpImg.UriSource = new Uri(@"///IMG//