RadicalFx / Radical.Windows

Radical is an infrastructure framework whose primary role is to help in the development of composite WPF applications based on the Model View ViewModel pattern.
http://www.radicalframework.com/
MIT License
3 stars 2 forks source link

IExpectViewShownCallback not triggered in a ViewModel associated with a Region #364

Open ucollina82 opened 3 years ago

ucollina82 commented 3 years ago

It seems that in a ViewModel associated with a Region the event of IExpectViewShownCallback is not triggered

ucollina82 commented 3 years ago

Seems that event IExpectViewLoadCallaback instead is triggered

mauroservienti commented 3 years ago

The problem here is that the events needed are not raised by WPF. When a view is resolved we attach the required behaviors. If the view is a window it gets a different behavior than if it's a user control.

@ucollina82 can you explain what is the need? Why there is a need for a view shown event when using regions?

ucollina82 commented 3 years ago

In this circumstance there was the need to understand when to initialize the viewmodel of a usercontrol (in a region) starting from the loading of the view. It was then chosen to hook to the IExpectViewLoadedCallback event but if there is another way to do this in a Region, that's fine