prism

Can someone explain the magic going on in Prism's resolve<> method?

I've got a CustomersModule.cs with the following Initialize() method: public void Initialize() { container.RegisterType<ICustomersRepository, CustomersRepository>(new ContainerControlledLifetimeManager()); CustomersPresenter customersPresenter = this.container.Resolve<CustomersPresenter>(); } The class I resolve from the cont...

How can I loosely reference modules in Prism so they can or cannot exist?

In this stackoverflow question I learned that Prism/Unity is not as decoupled as I thought, e.g. if I have this class which gets menuManager injected into its constructor, then I have to make sure that this class actually exists somewhere (I thought that you could just pull the .dll that contains the class and the container would deal wi...

In Prism, how do I inject an interface into my module constuctor instead of a type?

In my prism application I'm getting the error Activation error occured while trying to get instance of type CustomerModule, key \"\". It's caused by the fact that my customers module I'm trying to inject a "menuManager" of type IMenuManager: namespace CustomerModule { public class CustomerModule : IModule { private rea...

Why is my injected dependency object not the same instance in every module?

I'm using Prism and Unity. I've got this bootstrapper: protected override IModuleCatalog GetModuleCatalog() { ModuleCatalog catalog = new ModuleCatalog() .AddModule(typeof(CustomerModule.CustomerModule)) .AddModule(typeof(EmployeesModule.EmployeesModule)) .AddModule(typeof(MenuModule.MenuModule)); return...

What is the difference between Prism's IContainer and IUnityContainer?

I've got a Prism project with code that I've gotten from various sources, everything is working quite nicely, but I noticed that in some modules I inject IContainer container and in other modules I inject IUnityContainer container IContainer only seems to have Components, Add, and Remove while IUnityContainer has dozens of methods...

MVVM, Prism and Service Discovery

Hi, I'm writing an application (Silverlight and WPF) using the MVVM pattern and the Prism framework. In my application I have a grid that contains a list of customers. Under that, I various views that present customer details. All of the information is fed from a WCF service that provides data from queries as well as callbacks which fir...

Why would ItemsControl show a view but ContentControl show nothing?

I've got an application based on Prism. This is my shell: <Window x:Class="AvarioCRM3.ShellV2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" > <DockPanel LastChildFill="True"> <Border ...

What is the best C# collection with two keys and an object?

I've got a MenuManager class to which each module can add a key and and element to be loaded into the main content: private Dictionary<string,object> _mainContentItems = new Dictionary<string,object>(); public Dictionary<string,object> MainContentItems { get { return _mainContentItems; } set { _mainContentItems = value; } } So...

Composite WPF (Prism) module resource data templates

Given that I have a shell application and a couple of separate module projects using Microsoft CompoisteWPF (Prism v2)... On receiving a command, a module creates a new ViewModel and adds it to a region through the region manager. var viewModel = _container.Resolve<IMyViewModel>(); _regionManager.Regions[RegionNames.ShellMainRegion].Ad...

In Composite WPF (Prism), can/should multiple modules share a 'toolbar' region?

I'm very new to Composite WPF and I'm struggling with the basic architecture of the shell. Assume I have a Shell with three regions - 'OutlookStyleNav', 'Main' and 'Toolbar'. How do I add buttons to the toolbar region? Should each module add it's own button(s) to this region? (and if so, how to display all modules' buttons at the sam...

In Composite WPF (Prism), how should I unit test my controllers?

I'm building a basic Composite WPF Shell with one Module. I would like to unit test my module. Apparently Composite WPF modularizes my code in such a way that it should be easy to unit test. Below is the code I would like to Unit Test. It resides in my Module's Controller. Note the use of the standard Composite WPF entities like Region...

How can I have Prism/Unity automatically resolve a View (UserControl)?

In a Composite Application (Prism), when my module loads, I get this error: {"The current build operation (build key Build Key[CustomersModul.ViewModels.CustomerAllViewModel, null]) failed: The parameter view could not be resolved when attempting to call constructor CustomersModul.ViewModels.CustomerAllViewModel(Customers...

Does Prism/Unity have a "service preloader"?

I've got a number of modules in a Prism application which load data that takes 3-8 seconds to get from a service. I would like to be able to say in my bootstrapper something like this: PSEUDO-CODE: Customers allCustomers = Preloader(Models.GetAllCustomers); And this would run in a background thread and when the user actually needs t...

How fine grained should modules in Prism be?

Hey girls and guys! I am currently working on a project of mine using Prism (the Composite Application Library/Guidance). The application will be a specialized MSPaint-like application for basketball (predefined objects for balls, players etc.). Now I am wondering how to go about organizing my application into Prism modules. Especiall...

Is it possible (and reasonable) to use MEF and Prism (CAL) in one project?

Hey girls and guys! I am currently working on a WPF project using Prism (CAL) and am wondering if it is a good idea to use both Prism and MEF in one project. I would use Prism for modularity and MEF for extensibility. My project is a paint-like application so Prism would provide the module-separation (toolbox, canvas as modules etc.) a...

Can I use Ninject for Prism event aggregation in Silverlight?

I'm looking into doing a project in Silverlight 3 using Prism and I really like the eventing aggregation as shown here http://development-guides.silverbaylabs.org/Video/Prism-Eventing All the resources seem to be pointing to using Unity with Prism and not Ninject. In Ninject is there a similar way of aggregating events? Or if I want to ...

WPF Binding: Refreshing Binding after reload of combos from database

I've got two combo's 'Make' and 'Model', they've got their SelectedValue properties bound to an Vehicle object with a ModelID and a MakeID. Heres Model ... <ComboBox DisplayMemberPath="Description" ItemsSource="{Binding Path=ModelSpecs}" SelectedValue="{Binding Path=Vehicle.ModelID}" SelectedValuePath="ID" /> A user can search for Ve...

How can I create a file with StreamWriter using a relative path?

When I run the following code, an XML file is correctly created in c:\temp: XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection<Models.Customer>)); using (StreamWriter wr = new StreamWriter("C:/temp/CustomerMock2.xml")) { xs.Serialize(wr, CustomerList); } However, I actually want it to be created in a sub-directory un...

Why will my modules not fill the full DockPanel in my Shell.xaml?

In my Shell.xaml I want two modules to each take up half the height and be expandable. Why is the first module being cut off? Shell: <Window x:Class="HelloWorld.Desktop.Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.code...

Composite Application Block Region injection slow

Im building a wpf app with the composite application block ("prism") V2, and Im having an issue where a user control that is injected by a module is very slow in rendering. The user control contains a datagrid with some 2000 rows in it and there is considerable lag in the control rendering to the screen. Initially I thought the slowness ...