eventaggregator

Composite WPF EventAggregator subscriptions being lost

In my Composite WPF application I have an event that is published when the user double-clicks on a control. Modules subscribe to the event and perform an action when necessary. This event seems to stop working at random. Sometimes when I run the application I can trigger the event with no problems, other times I can only trigger it a fe...

EventAggregator for Java ?

Is there an equivalent of Microsoft's Prism EventAggregator for Java? ...

How to publish an event in my module's constructor?

When I try to publish an event in my Customer Module, it doesn't work (the subscriber does not receive the object, displays nothing): public class CustomersRegister : IModule { private static IRegionManager regionManager; private static IRegion region; private static CustomersMainView view; private s...

Why does my Moq IEventAggregator verification fail?

I use Composite WPF(Prism) and I am trying to unit test that my Controller does in fact subscribe to a Composite Event. My subscription code looks as follows... //Init Events. this.eventAggregator.GetEvent<PlantTreeNodeSelectedEvent>().Subscribe( ShowNodeDetails, ThreadOption.UIThread); My unit testing code looks as follows (I us...

Windsor Castle: Hooking up to container's resolving and releasing mechanism

I'm trying to implement automatic registration of my listeners to a singleton event aggregator when listeners are created by the IoC container - basically what Jeremy D. Miller is doing, but with Castle instead of StructureMap. So I want to be able to "intercept" Windsor's object creation mechanism and, if the object supports the marker...

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...

What is the best method to load Views dynamically from a Navigation control in Prism

I've implemented navigation through my application using a Menu control which publish an event using EventAggregator on click of menu item. Something like as shown below, this.eventAggregator.GetEvent<ViewRequestedEvent>() .Publish(new BusinessObject.Model.MenuModel { Modu...

How should I create my events for the EventAggregator from P&P so subscribers on the UI thread can listen to them ?

I am trying to update a progress bar in my main form while a background task is running. I am using the EventAggregator from the latest Patterns & Practices release route my application wide events. I am firing an event from a class listens to BackgroundWorker events and than fires an event as such: Process on bw fires the BW method ...

Prism Event Aggregation - subscriber not triggered

I'm working on implementing an event aggregation with Prism. I have a few modules, and I want each of them to subscribe to events that tells them when they are requested. I started out doing an all plain example with both subscribed and publisher in the shell. No problems there. Now; when I move the subscribers out to my modules they don...

Screen synchronization - Event Aggregator VS Caching ViewModel References...

Hi, i did some homework and couldn't find any article about best practices about when to use each method.. just for clarification: When using the event aggregator pattern : each screen has it's own reference of a viewmodel, the viewmodel publish changes using the eventaggregator, which later the observers use to synchronize their state....

Extend EventAggregator to log to a bus

Requirement I'm using PRISM for developing a financial application. Our requirement is to be able to communicate across modules/process/machine boundaries. For our first delivery we only want to be able to communicate between modules. However, we want to build a design which can be extended to cross-process/machine at a later stage wi...

How Can I Add Event Aggregation To An Existing Silverlight App?

I have an existing Silverlight application where Page.xaml has some buttons on it that load user controls into a TransitioningContentControl content host. Each of these user controls is bound to a viewmodel. Sometimes when changes are made to one user control, data in others would need to be updated. I have been looking at using the eve...

Can Prism EventAggregator be used for threading needs?

Hi, I was looking at Prism EventAggregator and its' great. I part i was most concerned was its capability to marshal thread correctly to UI thread. I was wondering if i can use this capability to provide module developers a class which could be used to create threads in a similar way as BackgroundWorker. Interface of class can be some...

Event Aggregator Implementation Sample / Best Practices

I'm looking for samples / best practices of Event Aggregator implementation. Anyone help ? ...

How do I test Prism event aggregator subscriptions, on the UIThread?

I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here, I just instantiate a real one and pass it to the system under test. In my test I then publish the event via that aggregator and then check how my system under test reacts to it. Since the event wil...

Castle Windsor: custom processing when starting service

Is it possible to perform some custom processing when Windsor instantiates a type? Something similar to: container.Register( AllTypes.Pick() .FromAssembly(Assembly.GetExecutingAssembly()) .BasedOn<MyMarkerInterface>() .WhenInstantiating(instance...

WPF/SL EventAggregator implementation with durable subscribers behavior?

Hi. Currently I'm building an application using latest Prism for Silverlight 4. I've a module and in that module I've two views with view models. Also I've a module view with two regions for each view. In module initialization I'm registering my views and view models in Unity container and also register views with corresponding regions. ...

EventAggregator, is it thread-safe?

Is this thread-safe? The EventAggregator in Prism is a very simple class with only one method. I was surprised when I noticed that there was no lock around the null check and creation of a new type to add to the private _events collection. If two threads called GetEvent simultaneously for the same type (before it exists in _events) it l...

Translating EventAggregators usage of SynchronizationContext to VB.Net

Working with a fairly large VB.Net back office winforms application. 1 million+ LOC. Big ball of mud, 90% of all code is in Forms & other UI controls. Slowly introducing better architecture as time & recources allows, We've been using ideas from the EventAggrgator by Jeremy Miller. http://codebetter.com/blogs/jeremy.miller/archive/2...

How do I tell if an action is a lambda expression?

I am using the EventAgregator pattern to subscribe and publish events. If a user subscribes to the event using a lambda expression, they must use a strong reference, not a weak reference, otherwise the expression can be garbage collected before the publish will execute. I wanted to add a simple check in the DelegateReference so that if ...