开发者

binding background to resources file

开发者 https://www.devze.com 2023-02-09 06:07 出处:网络
I have some window and I want开发者_开发知识库 to bind it\'s background to file that is located under Resources\\DBSelection.jpg

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消