WPF Logical Resources

WPF Logical Resources
A Logical Resource in WPF is a XAML defined object that can be used by WPF elements inside the user interface.
You can declare a logical resource for the entire window and will be usable by all elements on that window, or you can declare it inside the Resources collection of an element, where it will be usable only within that element. You can also declare it for an entire application and it will usable anywhere.

       
              
              
       



       
            	
              	       
                      
            	
       



       
              
              
       


The application resources collection can be found inside the App.xaml file located in your project.

Every resource must have an x:Key property which defines the name of that specific object. It doesn’t have to be unique in the entire application, but it must be unique in the Resource Collection in which it was defined.

A resource in XAML can be accessed by using the {StaticResource name} syntax.


No comments:

Post a Comment