Custom Export Attribute

Jun 14, 2010 at 1:44 PM

Is it possible to create own Custom Export Attributes so it works with MEFedMVVM??

Jun 14, 2010 at 1:46 PM

This is my custom export attribute:

 

[MetadataAttribute]    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]    public class ExportView : ExportAttribute    {        public WidgetLocation Location { get; set; }
        /// <summary>        /// Gets the Service contract type        /// </summary>        public Type ServiceContract { get; private set; }
        public ExportView()            : base(typeof(UserControl))        {            this.ServiceContract = typeof(UserControl);        }    }

Jun 14, 2010 at 1:48 PM

This is how I importing this:

 

[ImportMany(AllowRecomposition = true)]        

public Lazy<UserControl, IExportViewMetadata>[] Widgets { get; set; }

 

Widgets is null everytime.

Coordinator
Jun 14, 2010 at 2:31 PM
are you using the latest MEFedMVVM? since import manay was a bug I fixed recently. Make sure you have the latest version of MEFedMVVM source

Regards
Marlon
WPF Blog - http://marlongrech.wordpress.com/
Microsoft MVP for Client App



On Mon, Jun 14, 2010 at 1:48 PM, pcedendahl <notifications@codeplex.com> wrote:

From: pcedendahl

This is how I importing this:

 

[ImportMany(AllowRecomposition = true)]        

public Lazy<UserControl, IExportViewMetadata>[] Widgets { get; set; }

 

Widgets is null everytime.

Read the full discussion online.

To add a post to this discussion, reply to this email (MEFedMVVM@discussions.codeplex.com)

To start a new discussion for this project, email MEFedMVVM@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com