prism

Broken binding with Prism, Silverlight and ViewFirst approach.

The problem we are having is that we cannot get binding to work in our prism silverlight application when using the view-model first approach. The view first approach work fine. We have gone over the official documentation and various web sites, but have still not resolved the issue. Below is the code for both the view-model first, and t...

How do I associate a keypress with a DelegateCommand in Composite WPF?

I am building a composite application using CAL/Prism. The main region is a tab control, with multiple types of views in it. Each view has a custom set commands that it can handle which are bound to toolbar buttons at the top of the window. I've done this before in non-CAL apps by simply setting the InputBinding on the command, but I hav...

Silverlight PRISM, instantiate a view and pass data into the viewmodel

Hi, I have been looking around and haven't found much information on this yet. I have a PRISM project set up and it all seems to be working so far, within the main class of a module I am programatically creating my views. What I am trying to do is get an object sent through to the viewmodel for each instance of the view. At the moment ...

Hotkey commands for Silverlight in MVVM?

I'm trying to fire commands based on keystrokes in Silverlight. As I understand you cannot use AccessKey or AcceleratorKey in Silverlight. Also it looks like the might be helpful attached property InputBindings does not work either. I started looking in other places. It looked like Prism was the way to get commands working in Silverligh...

Dynamic animations, Commands and separation of concerns

Scenario: I have a (numeric) textbox, a button, and a label. When the button is clicked I'd like the label to "animate" to the numeric value in the textbox (like a spinning dial) Given: a) that animations in storyboards cannot have databindings (because they are not FrameworkElements) b) the lack of triggers in Silverlight What is the...

Solution with over 100 projects takes over five minutes to build

I have a solution with over 100 projects. It takes a long time to build, and sometimes Visual Studio crashes during the build. How can I deal with this issue and minimize the pain? Have we gone horribly, horribly wrong somewhere? Some background on the problem: We are using CAB with WPF, and each module has a ui assembly and a "serv...

Creating objects using Unity Resolve with extra parameters

I'm using Prism, which gives be the nice Unity IoC container too. I'm new to the concept, so I haven't gotten my hands all around it yet. What I want to do now is to create an object using the IoC container, but passing an extra parameter too. Allow me to explain with an example..: I have a class that takes a commands object. This is r...

What is your experience with abandoning MVVM for UserControl-based WPF architecture?

We built an large application based on Composite Application Library and MVVM using Infragistics controls. In order to save time and make the application more straight-forward, we scrapped the MVVM requirement. We now have no Presenters or ViewModels and our Views have become simple UserControls which are created like this: BaseEditor....

Menu service in Prism application CAL

Hello all, I am trying to create a Prism (CAL) framework (this is my first forray into CAL) and am having difficulty devising a service for registering menu items for a region). Here is what I have come up with so far... /// <summary> /// Menu item service - allows any module to register menu items with any region /// </summary> public...

WPF - CAL - Multiple parents for single instance of control?

Hi, I am working on a PRISM / CAL solution, but the problem may be WPF specific: If I create one instance of an control (e.g. TextBlock) and add it as child to a StackPanel, there is no way to add it as "child" to another StackPanel (parent already set error). I kind of understand the reason (it also occurs when using the RegionManager...

EventAggregator vs CompositeCommand

I worked my way through the Prism guidance and think I got a grasp of most of their communication vehicles. Commanding is very straightforward, so it is clear that the DelegateCommand will be used just to connect the View with its Model. It is somewhat less clear, when it comes to cross Module Communication, specifically when to use E...

WPF Prism - To use Scoped Regions or not?

Hi, I have a WPF project based upon Prism Feb 2009 release set up as: Shell exposes a single ContentControl as "MainRegion" Another view (user control) defined in the Infrastructure project called SplitView exposes two additional regions "LeftRegion" and "RightRegion" also as ContentControl. Some of my application's modules need to di...

Expose Silverlight Control to Modules

I'm using Prism to build my application and 19 of my modules need to interact with an control from another module. Is there any way to expose a control? I really don't want to use the event system because it would too much of the responsibility on my one know to know about the data being passed to it. ...

Why isn't my command parameter binding correctly?

I'm trying to bind a button command to take the text of a textbox as a parameter when the button is clicked. My Xaml looks like this: <TextBox x:Name="InputBox" Width="250" TabIndex="1" Text="{Binding Path=MessageText, Mode=TwoWay}" FontFamily="Verdana" FontSize="11" Margin="0,0,4,0" /> <Button x:Name="SendButton" Width="50" ...

Trace PRISM / CAL events (best practice?)

Ok, this question is for people with either a deep knowledge of PRISM or some magic skills I just lack (yet). The Background is simple: Prism allows the declaration of events to which the user can subscribe or publish. In code this looks like this: _eventAggregator.GetEvent<LayoutChangedEvent>().Subscribe(UpdateUi, true); _eventAgg...

WPF - Prism - Activate and Deactivate views in a ContentControl region

Hi, In my application I only need one view visible at a time which is why I am using a ContentControl in my shell. The issue is that if I have one view visible (lets say View1) and I activate View2, everything is fine up to this point. Now the user presses the Close button on View2 after which the users end up looking at a blank screen ...

Silverlight - managing a large number of themes

Hi, I have a PRISM based silverlight solution under source control. In regards to theming I have a project for each theme, for example 'Theme_Summer', 'Theme_Winter' projects. In reality there may be over 30 of these theme projects. Each theme project contains a selection of resource dictionaries to hold the styles etc along with the im...

Where is the right place for resource used by controls in module when using prism?

Normally, all resources are put in app.xmal, or other resources xaml files(as resource dictionary) and then reference it in app.xaml. When applying prism pattern, for those module, there is no app.xaml file. Application class is replaced by a class implementing interface IModule. So where is the right place for resources used by contro...

Silverlight PRISM loading an external XAP module

Hi, I'm not sure if this is possible, but I am currently loading most of my modules from within the main application assembly, I am trying to now load external XAP modules. I have something like this: ModuleInfo themeModule = new ModuleInfo(); themeModule.ModuleName = "Theme_External"; themeModule.ModuleType = "Theme_External...

DelegateCommand Newbie Question

Good Day, I'm trying to get up to speed with PRISM and how it works with Silverlight/WPF. Is it possible to using DelegateCommands to open a new popup (Silverlight Window). If so, how would I go about doing something like this. Most of the samples I've seen so far involve using DelegateCommands to retrieve data (or some other similar...