I am using a WPF User Control implementing the ITxViewerControl interface in a viewer. One thing I have not yet managed to figure out is how to use images in custom viewers for Process Simulate. What I am trying to accomplish is to be able to uses images for creating custom button styles in WPF.
I have attempted to set an image file as an embedded resource and then reference it in the image tag as in...
<Image Source="Images\FlowStationImg.png" />
I have also tried placing the images in many places throughout the eMPower directory including eMPower and in the DotNetViewers/Images, in DotNetViewers itself, etc, while changing the address in the image tag to match.
I know i am missing something obvious, so I figured I'd reach out to the community to see if anyone else has the correct methodology to include an image as a part of a control in WPF in a Process Simulate Viewer.
Solved! Go to Solution.
That would be the answer in a normal desktop WPF application in some cases, but Process Simulate routes references differently. I suspect it is a combination of the URL I put in the XAML tag and placement of the image file, or in the build action I am setting it to.
It shows up in my design window, but not when Process Simulate starts up.
I am using a .png file as a test. It is set to build action Embedded Resource. Are you placing the image file somewhere for process Simulate to find?
You are using the wrong build action! Embedded Resource doesn't work. You have to use Resource.
From your first post I assume that you have am Image folder in your project, haven't you?
If so, my first code snippet would be correct!
I just added another image using the Add Existing item as a "Resource" build action as default and it worked. No idea why it hasn't worked before.
Yes, I was going about it all wrong with the Build Action, and assuming that Process Simulate was looking for me to store the image somewhere in eMPower. Thank you for clarifying for me. 6 Years of working with this API and I'm still learning lol.
Everybody is still learning. Learning will never stop and that is good!
By the way, I am really looking forward to the planned API training in May. Are there any news availabe? Will it take place im Munich?