Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Binding to an image

$
0
0

Hello All,

I have the following setup in my code behind:

            Binding myImageBinding = new Binding("Status");
            myImageBinding.Source = viewModel;

            myImageBinding.Converter = new ImplementationLayer.Converter.ImageConverter();
            BindingOperations.SetBinding(StatusImage, Image.SourceProperty, myImageBinding);

in my xaml I have the follwing defined:

<Image  Name="StatusImage" Height="40" HorizontalAlignment="Left" Margin="12,14,0,0" Stretch="Fill" VerticalAlignment="Top" Width="40" Grid.Column="1" />

How do I change the xaml, in order for the binding above, to be included in the xaml?

Thank you for helping...

Harriet


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>