You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation is not correct from the architecture point of view. It forces us to have both methods, when one of them might be surplus.
publicasyncvoidOnNavigatedTo(objectparameter){if(parameterislongorderId){// Do some stuff}}publicvoidOnNavigatedFrom(){// Useless}
Like SOLID Interface Segregation Principle says: Clients should not be forced to implement any methods they don’t use
That's why it would be better to split INavigationAware into two separate interfaces INavigatedTo and INavigatedFrom.
And as a part of code enhancement, it might be possible to make a parameter in OnNavigatedTo(object parameter) strongly typed for the cases, where we have only one possible navigation scenario.
Now
INavigationAware
interface looks like this:Current implementation is not correct from the architecture point of view. It forces us to have both methods, when one of them might be surplus.
Like SOLID Interface Segregation Principle says:
Clients should not be forced to implement any methods they don’t use
That's why it would be better to split
INavigationAware
into two separate interfacesINavigatedTo
andINavigatedFrom
.And as a part of code enhancement, it might be possible to make a parameter in
OnNavigatedTo(object parameter)
strongly typed for the cases, where we have only one possible navigation scenario.The text was updated successfully, but these errors were encountered: