(WASM) Native frame navigation using MVUX and C# markup, is it possible? #17976
-
Hi I'm trying to navigare from one page to another using the native frame naviation, I have made 2 attempt with 2 buttons, here is the page code:
and here the model:
The first attempt is adding the code brutally in the button command, in the second I added the frame in the model constructor and then navigate using a method. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Mhhh, I found a way to obtain the result but I feel it is quite wrong, probably I'm messing up...
|
Beta Was this translation helpful? Give feedback.
So the first approach of .Command(() => //in place code) is not supported. It's meant to use data binding to a Command that would be defined in your Model Method/ViewModel Command (depending if you're using MVVM or MVUX).
Second, when using a pattern like MVVM or MVUX, you keep your view code separated from your presentation/business code. Therefore, you typically need a navigation abstraction. You could define your own Navigation Service that abstracts the frame navigation and inject it in your model... OR. you could look into using our Navigation Extensions that already do all of that.
https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Navigation/NavigationOverview.html
…