Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <title> #3277

Open
BruceLeeCorner opened this issue Nov 13, 2024 · 1 comment
Open

[BUG] <title> #3277

BruceLeeCorner opened this issue Nov 13, 2024 · 1 comment

Comments

@BruceLeeCorner
Copy link

Description

Hi, dear guys,

I try to do this : _eventAggregator.GetEvent<AppConfigChangedEvent>().Publish();
But appConfigSource.GetConfig(); doesn't execute if my ViewModel like the following :

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.

I try debug prism source code ,find this :

image

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

@BruceLeeCorner
Copy link
Author

I use Prism.DryIoc 8.1.97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant