I have problem using picturebox in wpf, I cannot set the path in xaml, so I want to bind it to the main script.
my xaml has the following:
<Image x:Name="picturebox" HorizontalAlignment="Left" Height="250" Margin="20,20,0,0" VerticalAlignment="Top" Width="250" Stretch="Fill" Source="{Binding ImageSource}"/>
how do I bind that in main script?
I try:
def __init__(self):
self.picturebox.Source = os.path.dirname(__file__) + r'\abc.png'
but not success
error:
TypeError: expected ImageSource, got str