Open BruceLeeCorner opened 22 hours ago
Hi, dear guys,
I try to do this : _eventAggregator.GetEvent<AppConfigChangedEvent>().Publish(); But appConfigSource.GetConfig(); doesn't execute if my ViewModel like the following :
_eventAggregator.GetEvent<AppConfigChangedEvent>().Publish();
appConfigSource.GetConfig();
public MainWindowViewModel( IEventAggregator eventAggregator, AppConfigSource appConfigSource) { _eventAggregator = eventAggregator; _appConfigSource = appConfigSource; _eventAggregator.GetEvent<AppConfigChangedEvent>().Subscribe(() => { appConfigSource.GetConfig(); }); }
modify little to like this, It can work.
public MainWindowViewModel( IEventAggregator eventAggregator, AppConfigSource appConfigSource) { _eventAggregator = eventAggregator; _appConfigSource = appConfigSource; _eventAggregator.GetEvent<AppConfigChangedEvent>().Subscribe(() => { _appConfigSource.GetConfig(); }); }
Lambda Can't use method parameter appConfigSource, and have to use field _appConfigSource.
appConfigSource
_appConfigSource
I try debug prism source code ,find this :
is this a bug, please ? thank you.
none
WPF
Windows
No response
I use Prism.DryIoc 8.1.97
Description
Hi, dear guys,
I try to do this :
_eventAggregator.GetEvent<AppConfigChangedEvent>().Publish();
ButappConfigSource.GetConfig();
doesn't execute if my ViewModel like the following :modify little to like this, It can work.
Lambda Can't use method parameter
appConfigSource
, and have to use field_appConfigSource
.I try debug prism source code ,find this :
is this a bug, please ? thank you.
Steps to Reproduce
none
Platform with bug
WPF
Affected platforms
Windows
Did you find any workaround?
No response
Relevant log output
No response