Images in a WPF Custom Control Library
问题 I need to put an image in the default view of a custom control. However, whenever I try to test the control it can't locate the image. I have tried to compile it as an embedded resource and just a plain resource in VS. Neither of these have worked. So is there a correct way to do this? 回答1: Look at this post: How can I get a BitmapImage from a Resource? 回答2: That's probably because you specified the image path as a relative path. You should use the Pack URI Scheme to specify that the resource