Check the output window in Visual Studio for runtime data binding errors.
There are two problems with the code you've shown:
1) You've declared the
variable as either a local variable, or a field. WPF binding only works with properties.
2) Since you're binding to something defined in your code-behind, you need to set the
to the class instance which contains the property, either on the image itself, or somewhere higher up in the logical tree. The usual approach is to do that in the constructor.
Public Partial Class Window1 : Window
Public Sub New()
DataContext = Me
Dim base64string As String = ...
Dim bi As New BitmapImage()
bi.StreamSource = New MemoryStream(Convert.FromBase64String(base64String))
Dim img As New Image()
img.Source = bi
ImgSource = img
Public ReadOnly Property ImgSource As Image