I have the following simple button with an image as the template. The problem is that I want to change the image to a resource, instead of a content reference. I want to do this so I can share the DLL as a re-usable library, and it doesn’t work well when I do that.
How do I tell the Image object to use an embedded resource in a declarative way?
<Button x:Name='LogoutButton' Click='Button_Click'> <Button.Template> <ControlTemplate> <Image Source='Resources/logout.png' /> </ControlTemplate> </Button.Template> </Button>
Ok, I figured it out:
That is all there is to it. Reference it like you would a content path, and it works.