eventaggregator

prism null exception on Container.Resolve<IEventAggregator>()

给你一囗甜甜゛ 提交于 2020-01-25 08:30:27
问题 The line Resources.Add("eventAggregator", Container.Resolve()); raises Null exception. UPDATE I've added all classes to explain more. As @Axemasta said, there is no need to register IEventAggregator and I removed registration. Now I don't how to connect the Listview EventAggregator behavior to the EventAggregator. This is whole App.xaml code file. public partial class App : PrismApplication { /* * The Xamarin Forms XAML Previewer in Visual Studio uses System.Activator.CreateInstance. * This

Trying to understand the event aggregator pattern

心不动则不痛 提交于 2020-01-20 21:44:06
问题 I am trying to implement the event aggregator pattern in a simple way to learn it step by step. But i didn't find any book or nice video tutorial talking about it's implementation. I just found some good articles such as this http://weblogs.asp.net/rashid/archive/2009/03/05/use-event-aggregator-to-make-your-application-more-extensible.aspx and http://martinfowler.com/eaaDev/EventAggregator.html the first article is too big to let me understand the pattern and the second one is not completed :

How to communicate between ViewModels in WPF and how to control Views lifecycle

泄露秘密 提交于 2020-01-03 17:01:36
问题 There are three windows MainWindow, FirstWindow and SecondWindow. MainWindow can open FirstWindow and SecondWindow. Now my question is: How to open SecondWindow from FirstWindow, and close FirstWindow when the SecondWindow open. At this time, I can control SecondWindow but can't control MainWindow, just like using SecondWindow.ShowDialog() from MainWindow. After I click the "save" button on SecondWindow, the SecondWindow shall be closed and the DataGrid of MainWindow shall be updated. How to

Non-Generic CompositePresentationEvent and EventSubscription?

China☆狼群 提交于 2019-12-24 05:51:18
问题 I am trying to create a TPayLoad -free CompositePresentationEvent , that its delegate is parameterless. I want to have a global application event that takes no parameters such as UserLoggedInEvent , UserGotIdleEvent etc. etc. How should this be done with the Prism 4.0 event aggregation system? 回答1: This post clarified some things for me. Anyway I realize now the the Prism EA system is really clumzy tho. Here are some extension methods that focus on reducing the verbosity of the EA. 回答2: For

Caliburn.Micro EventAggregator

别来无恙 提交于 2019-12-23 18:20:31
问题 Apologise if this a really stupid question but I'm just getting started with caliburn.micro and I'm struggling with getting the eventAggregator, nothing seems to be subscribing... I'm not sure whether the problem is with the view model or the bootstrapper. Here is the viewmodel: class MainWindowViewModel : Screen { private readonly IEventAggregator _eventAggregator; public MainWindowViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; _eventAggregator.Subscribe

Event Aggregator Error Handling With Rollback

安稳与你 提交于 2019-12-23 04:05:15
问题 I've been studying a lot of the common ways that developers design/architect an application on domain driven design (Still trying to understand the concept as a whole). Some of the examples that I saw included the use of events via an event aggregator. I liked the concept because it truly keeps the different elements/domains of an application decoupled. A concern that I have is: how do you rollback an operation in the case of an error? For example: Say I have an order application that has to

Using Prism 6 Event Aggregator between view models with an object as the payload

孤人 提交于 2019-12-23 03:46:10
问题 Hi I'm hoping one of you could help me with some syntax. So I'm following this example https://www.codeproject.com/Tips/591221/Simple-EventAggregator-in-WPF-PRISM on using Prism Event Aggregator to send messages from one ViewModel to another. The following code works great when publishing a single string as the payload. internal class OrderSelectedEvent_SS : PubSubEvent<string> { private static readonly EventAggregator _eventAggregator; private static readonly OrderSelectedEvent_SS _event;

Prism - EventAggregator.GetEvent<>.Subscribe() - Using Generics & Contraints

爷,独闯天下 提交于 2019-12-20 03:35:23
问题 I am having an issue subscribing to events with the event Aggregator that comes as part of the prism framework. If I use something such as eventAggregator.GetEvent<string>().Subscribe(MyMethod) then it all works ok, my method fires when an event has been published. However, when moving to a more complex object other than I string I run into problems. I have a bunch of classes that all derive from an Interface (IRequest) for example I have my event class setup as follows public class MyEvent

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

一笑奈何 提交于 2019-12-18 13:07:26
问题 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 will be raised by a FileSystemWatcher during production, I want to make use of the automatic dispatch by subscribing on the UIThread, so I can update my UI once

Any specific architectural solution for WPF apps that need to aggressively push refreshed data from Model to View?

醉酒当歌 提交于 2019-12-14 02:32:45
问题 Being new at MVVM and SOLID development, I’m working on a small WPF app, and I realized that my app is non-conventional in some ways: All of my Model data needs to be refreshed very often either by polling (every second), or by utilizing callback functions (e.g. with Shell hooks and Automation events). All refreshed data need to be pushed to the View immediately. The View is strictly a display for the data; it doesn't expose any kind of data mutation feature. Currently I’m using the following