in code behind we set the imagepath of window background ,is there any way to get this value on the xaml and use it to set the background image
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the best case, the code behind is empty or just InitializeComponent is there.
Therefore I will highlight a way of accomplishing this and let changes in the
future become very easy!
You can easily set a DataContext for your Window (for example in the codebehind).
From this DataContext (which should implement INotifyPropertyChanged when this
path will change) you can easily bind to whatever you want.
Here is a small example: