PageRenderTime 41ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 20ms app.codeStats 0ms

/V4/MVVM RI/MVVM.Client/Infrastructure/ExportViewAttribute.cs

#
C# | 38 lines | 15 code | 1 blank | 22 comment | 0 complexity | f3d75ebb0407b0fa855c30183a9192e1 MD5 | raw file
 1//===================================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation and Silverlight
 4//===================================================================================
 5// Copyright (c) Microsoft Corporation.  All rights reserved.
 6// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
 7// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
 8// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 9// FITNESS FOR A PARTICULAR PURPOSE.
10//===================================================================================
11// The example companies, organizations, products, domain names,
12// e-mail addresses, logos, people, places, and events depicted
13// herein are fictitious.  No association with any real company,
14// organization, product, domain name, email address, logo, person,
15// places, or events is intended or should be inferred.
16//===================================================================================
17using System;
18using System.ComponentModel.Composition;
19using System.Windows.Controls;
20
21namespace MVVM.Client.Infrastructure
22{
23    /// <summary>
24    /// MEF Metadata attribute to ensure views are registered appropriately
25    /// </summary>
26    /// <remarks>
27    /// This works in conjunction with <see cref="ViewFactory"/> to locate views from the <see cref="System.ComponentModel.Composition.Hosting.CompositionContainer"/>
28    /// </remarks>
29    [MetadataAttribute]
30    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
31    public class ExportViewAttribute : ExportAttribute
32    {
33        public ExportViewAttribute(string viewName)
34            : base(viewName, typeof(UserControl))
35        {
36        }
37    }
38}