1.

What do you mean by resources in WPF?

Answer»

In WPF, a resource is a type of object that you can reuse across multiple PLACES. The resource concept provides a simple way for objects and values to be reused. For instance, you can use resources such as styles, BRUSHES, bitmap images, etc., in various places within your WPF application. A unique key is assigned to each resource so it can be referenced from other parts of the application. The WPF resources allow you to set properties of several controls at once. The background property can be set for multiple elements in a WPF application using a single resource, for example.  Resources can be DECLARED at:

  • WPF Resource declaration can be done at the application LEVEL in App.xaml.
  • In addition, WPF Resources can be declared at the Window/User Control level or at the Panel level.
  • In the event that your resource PROVISIONING needs grow, then you can declare them in a separate file called a Resource Dictionary that you can refer to at the application level or any other level you desire.


Discussion

No Comment Found