Page 2 of 2
image in XSharp app
Posted: Fri Oct 06, 2017 12:38 pm
by Chris
Guys,
This is exactly why I wanted to post the sample solution here. I am not really familiar with how WPF works, so I was hoping that indeed a couple of you guys would step in!
Chris
image in XSharp app
Posted: Fri Oct 06, 2017 12:53 pm
by Juraj
Hi Wolfgang,
Thank you for your reply.
The use of the images in the prg source code works in X# well, but I wanted it to work in the xaml code,so that a better solution can be used.
Juraj
image in XSharp app
Posted: Sat Oct 07, 2017 9:34 am
by Chris
HI Juraj,
Juraj Halás wrote:
Chris solution is ok but i would like if the images were not in exe, as Nick wrote, so I would like a solution in this way.
If the xaml code I use in C#, it works, the same xamlcode in X# does not work at runtime.
Can you please send me also this c# sample? I tried the same thing here too, adding the image in the XAML in the same way as you did in x# also in the c# app, but I could not get it to work at runtime in c#, either, unless I add the image in the solution and set it to Resource, as in the case with x#.
Important note, when adding the file, c# automatically marks it as Resource (not "Content" or "None" build action), so maybe you just haven't noticed that you are embedding the image also in c#? If not, please send me the sample to compare what's different, so we can make it work in x# as in c# as well.
Chris
image in XSharp app
Posted: Sat Oct 07, 2017 10:41 am
by Juraj
Hi Chris,
you are right, if I change the image property "Build Action" to "None", so the error occurs also in c#.
Juraj
image in XSharp app
Posted: Sat Oct 07, 2017 1:05 pm
by Phil Hepburn
Hi Chris and Juraj,
When I do my WPF screens I place the images in an image folder in the solution and set the BuildAction to 'Resource'. I always get the code and app to work this way.
Images attached to help out those interested.
Good Luck.
Ask if you need any more pointers and help.
Cheers,
Phil.
- CPreply_03.jpg (127.81 KiB) Viewed 321 times
- CPreply_02.jpg (78.95 KiB) Viewed 321 times
- CPreply_01.jpg (65.34 KiB) Viewed 321 times