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

Issue with INavigationAware in version 3.0.5 #1169

Open
keeleycenc opened this issue Jul 25, 2024 · 4 comments
Open

Issue with INavigationAware in version 3.0.5 #1169

keeleycenc opened this issue Jul 25, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@keeleycenc
Copy link

keeleycenc commented Jul 25, 2024

Describe the bug

INavigationAware behavior when inherited by both View and ViewModel:
"When both View and ViewModel inherit INavigationAware, the methods OnNavigatedFrom and OnNavigatedTo in the ViewModel do not get triggered. If I remove INavigationAware from the View, then it works normally in the ViewModel

To Reproduce

View:

 public partial class ProductionVolumePage : INavigableView<ProductionVolumeViewModel>, INavigationAware

ViewModel:

public class ProductionVolumeViewModel : ViewModelBase, INavigationAware

Expected behavior

Using the Wb2 control, when leaving a class, it requires creating and destroying controls in the View, and starting and stopping data update services in the ViewModel. This setup was functioning before the update to version 3.0.5, but now it no longer works.

Screenshots

No response

OS version

Version: Windows 11 Pro
Version Number: 23H2
Installation Date: February 29, 2024
Operating System Build: 22631.3880

.NET version

.NET 8.0

WPF-UI NuGet version

3.0.5

Additional context

No response

@keeleycenc keeleycenc added the bug Something isn't working label Jul 25, 2024
@keeleycenc keeleycenc changed the title Issue with INavigationAware in version 3.5 Issue with INavigationAware in version 3.05 Jul 25, 2024
@keeleycenc keeleycenc changed the title Issue with INavigationAware in version 3.05 Issue with INavigationAware in version 3.0.5 Jul 25, 2024
@keeleycenc
Copy link
Author

Was this update to INavigationAware expected or unexpected? In visual statistics, I use INavigationAware to create and destroy WebView controls as well as back-end data services Start and Dispose. The purpose is to save memory overhead. Release and close real-time data acquisition of databases, communications, events, etc., and keep only the necessary data in the backend so that the next time you open the page, there is no need to repeatedly initialize all Viewmodels. If this is expected, then I will take another approach and abandon INavigationAware. If not, I'll keep it. Wait for the next version fix

@chucker
Copy link
Contributor

chucker commented Jul 25, 2024

I suspect this is a regression resulting from #1116.

@pomianowski pomianowski self-assigned this Jul 26, 2024
@pomianowski
Copy link
Member

CC @textGamex

@textGamex
Copy link
Contributor

oh, I will fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants