.Net Interview Questions and Answers

Search:

Explain the difference between static and dynamicresource? (.NET WPF interview questions)

By : Shiv Prasad Koirala | Jan 26th, 2014 | Views : 2553 | Comments : 0 Bookmark and Share

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.


<Window.Resources>

<SolidColorBrush Color="LightBlue" x:Key="buttonBackground" />

</Window.Resources>


The above resource is binded with the below two textboxes statically and dynamically respectively.


<TextBox Background="DynamicResource buttonBackground}" />

<TextBox Background="StaticResource buttonBackground}"/>


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


 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi