Please suggest new features or improvements

Coordinator
Apr 28, 2010 at 5:35 PM

One future improvement I want is to remove the need to put [assembly:DesignTimeCatalog] in the assemblies that I want to load in blend

May 11, 2010 at 2:47 PM

Allow ExportViewModel without parameters. Name of the Export should then be the ViewModel Class name.

Coordinator
May 11, 2010 at 3:05 PM

Yea I like that idea... I am going to add this feature quite soon. Thanks for the feedback

May 20, 2010 at 11:26 AM

Don't know If it's good or not but some kind of service for logging. Should be NLog or Log4Net as default but should be switchable via MEF.

Coordinator
May 20, 2010 at 11:31 AM

actually this is something  that is coming up in the next release

 

May 20, 2010 at 12:01 PM

Ok, that is good news. Do you have any timeschedule for this release? I need logging in my application and I just want to know if I need to implement logging by my self or if I can wait. Thank's for the best MVVM framework!!

Coordinator
May 20, 2010 at 12:29 PM

in terms of timspan I am not sure yet... but if you want for now you can implement a simple logger and export it by [ExportService(typeof(IMyLogger)] and the start using it in your app...

May 20, 2010 at 7:02 PM

Hi,

It is not possible to use [ExportService] on a class in another project (that is copied to the Extensions folder). I get an error like this:

 

More than one export was found that matches the constraint '((exportDefinition.ContractName == "MEFedMVVM.Services.Contracts.IMediator") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "MEFedMVVM.Services.Contracts.IMediator".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.

It seems that you can't have the reference to the MeffedMVVM assembly in more then one project. I have one project for ViewModels etc and that project also needs the reference to export ViewModels and the UI project have Services that I tagged with [ExportService] that also needs the reference. Is this kind of structure not doable?

Coordinator
May 20, 2010 at 11:12 PM

send me a sample at marlongrech AT gmail DOT com. This is totally doable!

 

May 24, 2010 at 7:59 AM

Hi,

I found a very interesting blog from you about mefed converters (http://groups.google.com/group/wpf-disciples/browse_thread/thread/b6ec5993204a514d). Why is'nt that implemented in the current release? When I try to compile the supplied code in the blog i get an error at this class:

 

public class ConvertersFactory    

{        

/// <summary>        

/// Gets all Value converters        

/// </summary>        

[ImportMany(AllowRecomposition = true)]        

public IEnumerable<ExportFactory<IValueConverter, IConverterMetaData>> ConvertersFactories { get; set; }
        public ConvertersFactory()        

{            

CompositionInitializer.SatisfyImports(this);        

}    

}

 

the problem is that it can not find ExportFactory. Why??

Coordinator
May 24, 2010 at 8:05 AM
I decided to remove it since it was a WPF only feature and the same thing could not be done for SL...

Do you think I should put it back in?
Do you have a blog yourself? if you want I can do the code for you and you can blog about it ... what do u think? (I would of course add a link to your blog in the codeplex site

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



On Mon, May 24, 2010 at 8:59 AM, pcedendahl <notifications@codeplex.com> wrote:

From: pcedendahl

Hi,

I found a very interesting blog from you about mefed converters (http://groups.google.com/group/wpf-disciples/browse_thread/thread/b6ec5993204a514d). Why is'nt that implemented in the current release? When I try to compile the supplied code in the blog i get an error at this class:

 

public class ConvertersFactory    

{        

/// <summary>        

/// Gets all Value converters        

/// </summary>        

[ImportMany(AllowRecomposition = true)]        

public IEnumerable<ExportFactory<IValueConverter, IConverterMetaData>> ConvertersFactories { get; set; }
        public ConvertersFactory()        

{            

CompositionInitializer.SatisfyImports(this);        

}    

}

 

the problem is that it can not find ExportFactory. Why??

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


Coordinator
May 24, 2010 at 8:05 AM
I decided to remove that from the current release. Do you think its is that useful?
May 24, 2010 at 9:07 AM
Hi Marlon,

Thank's for the fast reply. I'm in a project now and I really like MEF and what it can help you with. I just want to "Add more things" to your framework and when I saw the mefed Converters for WPF I really liked it. It is a disadvantage that it's not working for SL but
still it's good to have I think.

I don't have an own blog, but I will be very glad if you could do the code for me/ous and put it on codeplex.

What do you think about adding usefull Triggers, Behaviours like MVVM Light's EventToCommand?? Mvvm Light is a usefull framework but if it's possible to not have more then one MVVM framework that would be nice. I mean, in SL the size of the xap's can be a problem if i's to big i think, at least here at Sandvik where some of our customers around the world don't have so fast connections.

What I want to do is to add my own Service, Actions etc to create a Sandvik WPF and Silverlight framework that we can use, so I have started to add ThemeService (http://wpfthemes.codeplex.com/ ) and AutoMapperService (http://automapper.codeplex.com) to your framework because I think that it's important for ous.

I haven't got it work yet. What I want is to have the engine for these functions in your framework but not the whole implementation. Instead, for example, when I want theme functionality I just add the themes to Extensions folder and then using the "ThemeService" to use
all the themes, and the same for AutoMapper. When I want that functionallity I just add the AutoMapper assembly (that is MEFed enabled somehow) to the Extensions folder.

I don't know if you understand what I want to accomplish but I want to get your framework "extensible" without having the full implementation in the MEFed framework to keep it small.


Best regards,

Patrik Cedendahl,
System Developer
Sandvik IT Services AB
SE-811 81 Sandviken, SWEDEN

Office Phone: +46 26 262997
Mobile: +46 70 2728110
http://www.sandvik.com
patrik.cedendahl@sandvik.com

"marlongrech" <notifications@codeplex.com> wrote on 2010-05-24 10:05:19:

> "marlongrech"
>
> From:
>
> "marlongrech" <notifications@codeplex.com>
>
> To:
>
> patrik.cedendahl@sandvik.com
>
> Cc:
>
> Date:
>
> 2010-05-24 10:05
>
> Subject:
>
> Re: Please suggest new features or improvements [MEFedMVVM:210893]
>
> From: marlongrech
> I decided to remove it since it was a WPF only feature and the same
> thing could not be done for SL...
>
> Do you think I should put it back in?
> Do you have a blog yourself? if you want I can do the code for you
> and you can blog about it ... what do u think? (I would of course
> add a link to your blog in the codeplex site
>
> Regards
> Marlon
> WPF Blog - http://marlongrech.wordpress.com/
> Microsoft MVP for Client App
>
>

> On Mon, May 24, 2010 at 8:59 AM, pcedendahl <notifications@codeplex.com
> > wrote:
> From: pcedendahl
> Hi,
> I found a very interesting blog from you about mefed converters (
> http://groups.google.com/group/wpf-disciples/browse_thread/thread/
> b6ec5993204a514d). Why is'nt that implemented in the current
> release? When I try to compile the supplied code in the blog i get
> an error at this class:
>
> public class ConvertersFactory
> {
> /// <summary>
> /// Gets all Value converters
> /// </summary>
> [ImportMany(AllowRecomposition = true)]
> public IEnumerable<ExportFactory<IValueConverter,
> IConverterMetaData>> ConvertersFactories { get; set; }
> public ConvertersFactory()
> {
> CompositionInitializer.SatisfyImports(this);
> }
> }
>
> the problem is that it can not find ExportFactory. Why??
> 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
>
> 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

This e-mail is confidential and it is intended only for the addressees. Any review, dissemination, distribution, or copying of this message by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message from your system. The sender does not accept liability for any errors or omissions in the contents of this message which may arise as a result of the e-mail transmission.

May 24, 2010 at 9:25 AM

Hi,

This code is just a starter for the ThemeService. Don't know if it's good or bad

 

 

[ExportService(ServiceType.Runtime, typeof(IThemeService))]
    public class ThemeService
    {
        [ImportMany(typeof(ITheme), AllowRecomposition = true)]
        public IEnumerable<ITheme> Themes { get; set; }

        public IEnumerable<ITheme> GetInstalledThemes()
        {
            return Themes;
        }


        /// <summary>
        /// Applies the theme.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="objectType"></param>
        /// <param name="theme">The theme.</param>
        public void ApplyTheme(object objectType, string theme)
        {
            var dictionary = GetDictionaryFromThemes(theme);
            if (dictionary == null) return;


            if (objectType is Window)
            {
                ((Window)objectType).Resources.MergedDictionaries.Clear();
                ((Window)objectType).Resources.MergedDictionaries.Add(dictionary);
            }
            else if (objectType is ContentControl)
            {
                ((ContentControl)objectType).Resources.MergedDictionaries.Clear();
                ((ContentControl)objectType).Resources.MergedDictionaries.Add(dictionary);
            }
            else if (objectType is Application)
            {
                ((Application)objectType).Resources.MergedDictionaries.Clear();
                ((Application)objectType).Resources.MergedDictionaries.Add(dictionary);
            }
        }

        /// <summary>
        /// Gets the dictionary from themes.
        /// </summary>
        /// <param name="theme">The theme.</param>
        /// <returns></returns>
        private ResourceDictionary GetDictionaryFromThemes(string theme)
        {
            var themeControl = Themes.Where(c => c.ThemeName == theme).SingleOrDefault();
            return themeControl.GetThemeResourceDictionary() as ResourceDictionary;
        }

        public void OnImportsSatisfied()
        {
            
        }
    }

May 24, 2010 at 9:36 AM

Mayby a "MEFed MVVM Contrib" ???

May 25, 2010 at 5:18 PM

One more feature could be a ConfigurationService where it should be possible to implement the functionality your self. Default should be App.config but "providers" database or whatever should be possible.

Jun 1, 2010 at 10:49 PM

I had an idea if it's possible to implement some AOP functionallity into this  framework that works against the exported services, like logging, validation etc.

Coordinator
Jun 2, 2010 at 3:08 AM

now that is an interesting idea... I will have a think at that! thanks !!!

Jul 6, 2010 at 7:57 PM
Edited Jul 6, 2010 at 7:58 PM

Opps wrong thread

Jul 7, 2010 at 7:47 AM

hi marlon, as far as i know was the intention of mefedmvvm to be an extensible for other mmvm frameworks. you may have a look at it. if you put more mvvm framework stuff in one .dll your mefemvvm becomes a framework itself :) maybe its good to cut mefedmvvm in Core.dll (just the MEF stuff and contracts) and put the nice goodis like mediator, loggin and so on in a  second mefedmvvm.goddies.dll

thx frank

Coordinator
Jul 7, 2010 at 8:51 AM
yes that is a good suggestions... yet at the same time I want to balance a bit... if someone is using MEFedMVVM on its own (many people do that) I don't want them to need to reference more then one DLL
Aug 26, 2010 at 7:52 AM

Hi Marlon,

I've encountered same problem as pcedendahl posted on May 21. I want to use [ExportService] on a Class from another project.

It seems you have solution on this problem, can you please help?

Thanks

Coordinator
Aug 26, 2010 at 8:00 AM

the trick is to do copy local = false on the references otherwise the assemblies will be loaded twice for MEFedMVVM

 

see this post it is a similar issue
http://marlongrech.wordpress.com/2010/05/03/mef-deploymentcatalog-and-reference-assemblies/

Sep 1, 2010 at 1:48 PM

great help, thanks.

Jan 25, 2011 at 4:58 PM
pcedendahl wrote:

Hi,

It is not possible to use [ExportService] on a class in another project (that is copied to the Extensions folder). I get an error like this:

 

More than one export was found that matches the constraint '((exportDefinition.ContractName == "MEFedMVVM.Services.Contracts.IMediator") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "MEFedMVVM.Services.Contracts.IMediator".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))'.

It seems that you can't have the reference to the MeffedMVVM assembly in more then one project. I have one project for ViewModels etc and that project also needs the reference to export ViewModels and the UI project have Services that I tagged with [ExportService] that also needs the reference. Is this kind of structure not doable?

 Hello Pcedendahl,

Did you ever get a resolution for this?  I'm having the same problem.

Thanks ahead of time,

Steve Johnson

Coordinator
Jan 26, 2011 at 7:56 AM

that is not a MEFedMVVM issue. you need to do the following otherwise MEF will try to load all assemblies (including MEFedMVVM which would already be in the main composition)

 

the trick is to do copy local = false on the references otherwise the assemblies will be loaded twice for MEFedMVVM

 

see this post it is a similar issue
http://marlongrech.wordpress.com/2010/05/03/mef-deploymentcatalog-and-reference-assemblies/

 

Jan 26, 2011 at 3:42 PM

Thanks Marlon; great product!

From: marlongrech [email removed]
Sent: Wednesday, January 26, 2011 12:56 AM
To: Steve Johnson
Subject: Re: Please suggest new features or improvements [MEFedMVVM:210893]

From: marlongrech

that is not a MEFedMVVM issue. you need to do the following otherwise MEF will try to load all assemblies (including MEFedMVVM which would already be in the main composition)

the trick is to do copy local = false on the references otherwise the assemblies will be loaded twice for MEFedMVVM

see this post it is a similar issue
http://marlongrech.wordpress.com/2010/05/03/mef-deploymentcatalog-and-reference-assemblies/