Replies: 1 comment
-
"Navigation" in WPF can implemented in many different ways. In the MD3 demo Navigation is not implemented on a Button click/RelayCommand.
etc.. The Here is the ContentPresenter with a Fuchsia colored Border and alot of margin around it, if that helps visualizing: As an alternative to the above, I have seen people implement Navigation via the Frame class. I think the latter one gives a more browser-like navigation experience. |
Beta Was this translation helpful? Give feedback.
-
Hi! First of all, I apologize if I’m missing something obvious, but I’ve been looking into the example of how to use the Navigation Bar with MVVM and I can’t seem to find a clear way to connect it properly.
Here’s the code I’m referring to (Design Material Demo):
Maybe this sample is for design purposes but I didn't find another example with mvvm to navigate.
Where is the usual command binding expected to go in this case? I’m used to working with buttons and binding commands to them. Should I create a RelayCommand inside the SampleItem class and then add a Button inside the ItemTemplate to bind the command?
If I do this, would it break the design? Since the NavigationBar style already seems to act like a button in the UI, even though I don’t see any clear command-related code. I’m not new to WPF, but I’m still getting used to using third-party UI libraries. Maybe this control isn’t fully documented yet, or maybe I’m missing something?
Thanks a lot for your help!
Beta Was this translation helpful? Give feedback.
All reactions