I have the following classes
ImageViewModel: INotifyPropertyChanged { ... String Url; } AdViewModel: INotifyPropertyChanged { ... ImageViewModel Image }
The Perodicaly AdViewModel modifies the Image property (animated ad).
When I have the following XAML:
<Grid> <Image Source="{Binding Image.Url}" Width="{Binding Image.Width}" Height="{Binding Image.Height}" />
And set the Grid DataContext to the instance of AdViewModel, everything works as expected. But I need to create XAML in C # code to use it elsewhere. Creating a grid and adding an image as its child is easy, but how do I create anchors?
source share