Setting image source in only in runtime (Without define it in the XAML)
Hi,
I'm trying to create XAML page with several images that will only be set in the code during runtime. Here is a sample of image tag from my XAML -
<Image Name="CloseAppWindow" Width="454" Height="256" Canvas.Top="45" Canvas.Left="24"></Image>
As you can see I did not specify the source for it since I want to do it through code. However the resources of the images are kept in a different project and no matter what I do to send them as parameters the XAML window is drawn without them.
Re: Setting image source in only in runtime (Without define it in the XAML)
Originally Posted by shak_pg
Hi,
Thanks for your replay.
Can you please explain further how to do the reflection?
Look into the attached sample POC.
It is developed in VS2010; so if you cant opn the solution, try looking into the files using the VS version that you have.
Re: Setting image source in only in runtime (Without define it in the XAML)
Thanks for the example but I did not understand how your example can help me.
I was talking about XAML(WPF) that will define images in the XAML but the source to that image will be decided upon runtime.
:-(
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.