prism

In Prism (CAL), how can I RegisterPresenterWithRegion instead of RegisterViewWithRegion

I have a module in a Prism application and in its initialize method I want to register a presenter instead of a view with a region, i.e. I want to do this: PSEUDO-CODE: regionManager.RegisterPresenterWithRegion( "MainRegion", typeof(Presenters.EditCustomerPresenter)); instead of loading a view like this: regionManager.RegisterV...

.NET Prism Bootstrapper GetModuleCatalog question...

Can someone please explain where GetModuleCatalog (Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.GetModuleCatalog()) is called in the Prism shell? I understand that it needs to be overridden in the application Bootstrapper, but I could not find out where it is called internally when running the Bootstrapper. ...

How can I display different ContextMenus in WPF ListView GridView?

I have a ListView GridView with ListViewItems that represent different categories of items. I'd like to display a different ContextMenu for each category of item. I was hoping to do this using DataTemplates but I'm struggling. My TreeView has a DataTemplate per category and I can see how I can set a different ContextMenu for each ther...

Prism - Commands Not Firing

Hi, I've got a view <UserControl x:Class="Modules.NavigationMenu.Views.NavigationMenuView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <StackPanel> <Button Command="{Binding InspectionCommand}">Inspection</Button> <Button Com...

Does ninject-contrib support Silverlight?

I'm building a Silverlight application with Prism, and we'd like to use NInject. I've downloaded ninject-contrib to use their NInject bootstrapper, but it doesn't appear to build a Silverlight assembly. I compiled it myself to Silverlight, but it crashes Visual Studio. Has anyone already ported ninject-contrib to Silverlight success...

Using Prism for navigation in Wpf application

I'm starting a new project in Wpf, and am now looking into using Prism. For now I'm simply trying to set up the navigation of the application using Prism. Unfortunatelly my lack of experience with the framework makes it a bit difficult to get started.. To be more precise about my first challenge I have an application with a "navigation...

Wpf Prism application architechture with the MVVM pattern

I'm currently introducing Prism to a new Wpf application, and am using the MVVM pattern. My initial approach of structuring the Wpf application was to add one project to hold the model classes, one to hold the viewmodel classes, etc. These might be split at a later time to avoid having different logical components in the same project. Ho...

Available Prism Region controls

I'm new to Prism, and I tend to just do as in the samples I see; place the Regions inside an ItemsControl. I have read that more controls can be used for defining region, but not all. However, I haven't seen an overview on what controls can be used to define Prism regions and not. Is there a rule or a list to it? <ItemsControl x:Name="...

Composite Application guidance (PRISM) and Models

Where in the solution/projects, should I put the models for the data access layer. For example, if I have a login module that needs to use a Users table in a database, and I have a User.cs model. Where would that file go. If other modules need to be able to access this User.cs for information, then I cannot put it in the module. But then...

Prism2/MVVM Close View from ViewModel

How do I close a View from its ViewModel? I've a WPF window which has defined multiple Regions and being used as a Shell to host views for my application. I would like to have a View able to remove itself from the Region, or close it from a tabbed container. How can I accomplish this behavior from ViewModel. ...

How to dynamically load modules in Prism / Composite Application Library?

I have a class in my Prism/CAL application which generates a form for users to fill in data. The form is defined by an XML file like this: <area idCode="general" title="General"> <column> <group title="Customer Data"> <field idCode="title" requiredStatus="true"> <label>title</label> ...

Removing View from Region in Silverlight PRISM

I have a Region which can have only one active view at a time. I want to add new view to the region on user action and remove the existing view from the same region. I also want to maintain the cache of few views. If the no of view is more than the specified limit then I will remove the oldest view. Is there any direct support for it or ...

In Composite WPF (Prism), what is the difference between IRegion.Add and IRegionManager.RegisterViewWithRegion?

In Composite WPF (Prism), when adding modules to the IRegionManger collection, what is the difference between using IRegion.Add and IRegionManager.RegisterViewWithRegion? IRegion.Add public void Initialize() { _regionManager.Regions["MainRegion"].Add( new ModuleAView() ); } IRegionManager.RegisterViewWithRegion public void Initi...

MVVM - Should the View have a reference to the Presenter/ViewModel?

I've been looking through the PRISM 2 samples for ideas about how to best approach a new application I'm working on, which will be a PRISM 2/WPF app. Looking in particular at the View Injection sample application that ships with PRISM I've noticed that all of the views implement an interface which allows the presenter (or ViewModel) to i...

WPF - MVVM Command binding on Sub ViewModel

Hi, I've got a VehicleViewModel that has a sub ViewModel of NotesViewModel public IManageVehicleNotesViewModel NotesViewModel { get; set; } On the first activation of VehicleViewModel I activate the sub ViewModel. NotesViewModel.Activate(); The activation calls a method to init a number of Commands, I've break pointed this and its...

ICommands and the "CanExecuteMethod" of a DelegateCommand Why doesn't it work for us!?

We're trying to use an ICommand to set up a button in Silverlight with Prism. We'd like the button to be disabled on occasion. DelegateCommand takes 2 parameters, an "ExecuteMethod" and a "CanExecuteMethod" When we set up the ICommand we expect that if the "CanExecuteMethod" is used, then it will be called to see if the "ExecuteMeth...

Silverlight Action and Prism

When using Prism for composition in Silverlight how do I attach actions between modules? Am I forced to use the event system or is there a way to set the TargetName for my Actions to the name of a UserControl in a different module? For Example: <Image Height="40" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="40" Source...

Silverlight PRISM and 'loose' style files

Hi, We are looking at starting a new Silverlight project using the PRISM framework (to benefit from modules etc) and I am still a little unclear about the best styling approach. What I'd ideally like is to have editable XAML files (maybe even just 1 for the whole project) containing the application's style so that they can be edited to ...

Add Composite WPF Region at runtime

Ok, here's my simple scenario. I've got collection of strings that I'm binding to a TabControl as a proof of concept. As I add strings I want a new tab with the region name as the header and a ItemsControl in the Tab container. That ItemsControl should define a new region. <TabControl x:Name="tabDemo" ItemsSource="{Binding D...

Silverlight PRISM, displaying/hiding modules question

Hi, I have created a project using the PRISM framework. I have a few modules that I can register and display in the shell and this works fine. What I need to do is dynamically display and hide the modules when a particular event is received from the event aggregator. I fire off a DisplayModule event that should be received and hide an ...