Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Metadata

One of the most powerful features of MEF is the ability to tag parts with metadata. This enables your application to interrogate information about a part before an instance is created. Practical uses include determining which parts to use depending on whether you are connected to a network or are offline, choosing a language, and routing related types such as views and view models together.

Tagging data is simple. There are two ways to do it. The first method is weakly typed and involves adding metadata as a string key and value, much like a generic dictionary. For situations that require more strongly typed metadata, you can specify a contract and create a special attribute that honors the contract for metadata. First, you will learn how to use the weakly typed metadata.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial