I have some window
and I want开发者_开发知识库 to bind it's background to file that is located under Resources\DBSelection.jpg
How i can do it ?
Thanks.
<Window.Background >
<ImageBrush ImageSource="Resources\DBSelection.jpg" > </ImageBrush >
</Window.Background >
You can not bind to files, you can only bind to public properties/dependency properties. So if you need a binding you could pipe the image through a property in your code. You also would need something like a FileSystemWatcher
so you can send a notification that the file changed.
精彩评论