Wpf Prism服务是否可以公开IObservable<;T>;消除对IEventagegrator的需求?
我们是否可以通过以下方式消除对Wpf Prism服务是否可以公开IObservable<;T>;消除对IEventagegrator的需求?,wpf,system.reactive,prism-4,Wpf,System.reactive,Prism 4,我们是否可以通过以下方式消除对IEventAggregator的需求: namespace MyApp.Shared.Services { public interface IMyPrismService { string GetApplicationProperty(string key); void SetApplicationProperty(KeyValuePair<string, string> pair);
IEventAggregator
的需求:
namespace MyApp.Shared.Services
{
public interface IMyPrismService
{
string GetApplicationProperty(string key);
void SetApplicationProperty(KeyValuePair<string, string> pair);
int GetMyWidgetCount();
IObservable<IEnumerable<MyOtherWidget>> ReactToMyOtherWidgetsLoaded();
}
}
名称空间MyApp.Shared.Services
{
公共接口IMyPrismService
{
字符串GetApplicationProperty(字符串键);
void SetApplicationProperty(KeyValuePair对);
int GetMyWidgetCount();
IObservable对其他WidgetSloaded()的反应;
}
}
?
当这种模式被视为有用时(即使
IEventAggregator
很酷),人们会如何使用反应式扩展来设置它呢?我可能想考虑一下:这很容易做到,但为什么?