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
Add Navigation Lifecycle interfaces similar to what you see in Prism. This would be helpful across all programming paradigms (MVVM & MVUX) where you can make a single navigation call and pass state which can be responded to properly in the View's DataContext regardless of what pattern it follows.
publicinterfaceINavigationAware{voidOnNavigatedFrom(NavigationStatestate);voidOnNavigatedTo(NavigationStatestate);}publicenumNavigationType{New,Back}publicinterfaceIParameters:IEnumerable<string,object>{voidAdd(stringkey,objectvalue);
T Get<T>(stringkey);boolTryGet<T>(stringkey,Tvalue);}publicrecordNavigationState(NavigationTypeType,IParametersParameters);
Why is this needed
Currently if I am going to Navigate to a given View and I need to update it's state, I must both write code to do the navigation and also trigger some sort of PubSubEvent that can be listened to. This is overly complex and can be greatly simplified by simply providing a common approach with interfaces that doesn't care about the Presentation layer's model (MVVM/MVUX) and simply requires less code from the developer as they can now simply Navigate and pass the state which can then be passed to a known method where they can perform their own custom updates and handle what they need to.
This discussion was converted from issue #2175 on May 07, 2024 06:10.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What would you like to be added:
Add Navigation Lifecycle interfaces similar to what you see in Prism. This would be helpful across all programming paradigms (MVVM & MVUX) where you can make a single navigation call and pass state which can be responded to properly in the View's DataContext regardless of what pattern it follows.
Why is this needed
Currently if I am going to Navigate to a given View and I need to update it's state, I must both write code to do the navigation and also trigger some sort of PubSubEvent that can be listened to. This is overly complex and can be greatly simplified by simply providing a common approach with interfaces that doesn't care about the Presentation layer's model (MVVM/MVUX) and simply requires less code from the developer as they can now simply Navigate and pass the state which can then be passed to a known method where they can perform their own custom updates and handle what they need to.
Beta Was this translation helpful? Give feedback.
All reactions