mef

Visual Studio 2010 Extension Manager crashes

After installing a bunch of extensions to try out I restarted VS 2010 and it started crashing. Unfortunately, it consistently crashes when opening Tools | Extension Manager. Any ideas how to fix and avoid a complete uninstall/reinstall? Event log has this: Application: devenv.exe Framework Version: v4.0.30319 Description: The process w...

How to get at ResourceDictionary style when it is loaded from external xap and assemblies are MEF-fed?

I've got the following setup: The main application loads a XAP with an IPlugin implementation. The Plugin contains a 'DisplayPanel' that contains a referenced Control with other controls. The DisplayPanel here is simply a container control to show referenced Control. This referenced Control, from an assembly, uses a Style from a Resourc...

Using MEF to build a tabbed application dynamically

I'm rather taken with MEF and plan to use it to build a demo application to load different tabs. I am a begineer at MEF and WPF and although MEF is loading the assemblies I'm stuck at loading the controls into the TabItem I have created. My code looks a bt like this .. foreach (var page in pages) { ...

MEF and ASP.NET MVC

I want to use MEF with asp.net mvc. I wrote following controller factory: public class MefControllerFactory : DefaultControllerFactory { private CompositionContainer _Container; public MefControllerFactory(Assembly assembly) { _Container = new CompositionContainer(new AssemblyCatalog(assembly)); } protect...

Ideal place to compose parts when using MEF + MVVM light toolkit?

Now that I'm working on my newer application that uses MEF with the MVVM light toolkit, I've run into a case where I can't load specific plugins because they rely on a part that isn't getting exported. That part isn't getting exported because it's a View, and the View isn't resolved with MEF (yet). It seems that every time I play with ...

MEF import problem with CreationPolicy

below is the demo of my problem, I'd like to create many child which have a reference to their parent. How to write the import attribute to get the parent reference instead of create a new parent instance? public partial class MainPage : UserControl { [Import(typeof(Parent))] public Parent Parent1 { get; set; } [Import(ty...

Accessing embedded resources from MEF loaded XAPs

Hi all, Simple question. So MEF doesn't support importing or exporting loose files (such as xml files) etc. However, it should at least support embedded resources right? I currently have a silverlight application that loads xaps dynamically. These dynamically loaded xaps each have an xml file attached as an embedded resource accesib...

Linking controls from other DLLs

Dear SO, I'm having some issues with Silverlight 4/ MEF. I have a basic framework setup with a Silverlight Navigation app at the core utilizing MVVM where i can. Image link to the diagram for clarification(not including all the VM classes) The main app (Desu) contains some pages and controls that export en import nicely. I dynamicly l...

Deployment catalog uri from part

Hi, I have aggregate catalog and i'm loading deployment catalogs into it. Is it possible to find out later deployment catalog uri from part that i'm using. Tnx! ...

MEF: Satisfy part on an Export using and Export from the composed part.

Hi, I have the following scenario in Silverlight 4: I have a notifications service Snippet [InheritedExport] public interface INotificationsService : IObservable<ReceivedNotification> { void IssueNotifications(IEnumerable<ClientIssuedNotification> notifications); } and and implementation of this service Snippet [PartCreationP...

Cannot navigate to the page, in downloaded xAP through MEF

Hi there, I 've a master navigation project with TABS etc... Now when I click on any of this tab, it will download a saparate XAP file, using MEF. The XAP file also have got their own navigation with the menu bars. Now I want this when I am clicking on any of this menu it shows the page from the xap file. However, it is not able to f...

MEF export of Repository<T> : IRepository<T>

I am trying to use MEF to Export the following: [Export(typeof(IRepository<>))] public class Repository<T> : IRepository<T> where T : class { With an import of [Import(typeof(IRepository<>))] private IRepository<Contact> repository; But I keep getting an error message when composing MEF of: ====================================...

Cancel - Wpf Application.Current.Shutdown()

hi, are there any ways to cancel Application.Current.Shutdown(); background: i played with mef a little bit and put some plugins to my main app. if any plugin call Application.Current.Shutdown(); my main app shutdown too and i got no chance to cancel this. are there any ways? ...

Lazy load with MEF ?

Take a look at this code : public class Program { [import]IMain Main {get; set;} ... private Compose() {...} } internal interface IMain { ... } [Export(typeof(IMain)] public class Main : IMain { [import] Interace1 Object1 {get;set;} [import] Interace2 Object2 {get;set;} } ... I want to lazy load Object2 after the compositio...

How can I unload a dll in order to delete it after a MEF recomposition ?

1) With MEF, I compose my DLL 2) I work with my DLL 3) I recompose without this DLL 4) I want to delete it // => it doesn't work How can I unload a dll in order to delete it after a MEF recomposition in which this dll is not composed ? ...

Extensible WPF application - MEF, MAF or simple loading?

(I know about the other MEF/MAF questions but this is a more specific problem) I want to create a WPF application that will basically be just a simple add-in host, GUI and settings. All of the actual work will be done by one or more plugin(s). They don't need to communicate between each other, the main application will send user input/c...

How to switch view in MVVM using MEF

I have a singleton Model and ViewModel objects and would like to programmatically create and attach WPF views to them, one at a time. Views can be created dynamically, say by selecting a menu item (somewhere). Newly created view would dispose of any old view looking at a ViewModel. Then it would make itself a current view of that ViewMod...

MSMQ/.EXE vs. Web Service.... MEF IoC?

We are debating to correct way to setup a notification service. This serivce will be called by various apps and the service will need to return relevant data back. My feeling is you just create a Web service that the intranet portal (or anything) could access by sending the user ID and in return getting any information (User 425 report ...

Type.GetType returns null when using MEF

I'm currently using MEF for a project to import plugins, as the plugins are written in WPF they each have a view and a viewmodel. The plugins know about the viewmodel but the main shell UI will construct the view and bind the viewmodel using a convention over configuration type pattern. I have used some code from the Build-your-own-MVV...

MEF Global CompositionContainer in existing applications

I'm researching MEF as a solution to plug-in resolution in our existing .NET Application. In all of the examples that I can find, the main application creates an instance of the CompositionContainer and calls container.ComposeParts(this). The problem is, my application is not entirely built on MEF, so there is a hole in the object grap...