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
image in XSharp app
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
image in XSharp app
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
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
HI Juraj,
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
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#.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.
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
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
image in XSharp app
Hi Chris,
you are right, if I change the image property "Build Action" to "None", so the error occurs also in c#.
Juraj
you are right, if I change the image property "Build Action" to "None", so the error occurs also in c#.
Juraj
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
image in XSharp app
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.
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.