Explain the difference between static and dynamicresource? (.NET WPF interview questions)
This question is taken from the .NET interview question with answer video series provided by www.questpond.com
Resources can be referred statically or dynamically. Static referred resources evaluate the resource only once and after that if the resources change those changes are not reflected in the binding. While dynamic referred resources are evaluated every time the resource is needed.
Consider the below "SolidColorBrush" resource which is set to "LightBlue" color.
The above resource is binded with the below two textboxes statically and dynamically respectively.
Now if we modify the resource , you see the first text box changes the background and the other textbox color stays as it is.
Below is the output of the same.
Below video explain what is WPF and how they differ from Windows form