BartekW
Topic Author
Posts: 53
Joined: 24 Mar 2021, 14:33

Re: Keyboard Navigation - how to make a tree of focusable input?

05 May 2021, 14:43

What if I would have 10 menus (whole menu with submenus), can I have 1 ViewModel for them or ViewModel per menu?
 
KeldorKatarn
Posts: 193
Joined: 30 May 2014, 10:26

Re: Keyboard Navigation - how to make a tree of focusable input?

05 May 2021, 20:24

You want to databind a ContentControl to the a property on the ViewModel. That property will change to whatever should be displayed. Then you define the UserControls as DataTemplates for these types.

https://stackoverflow.com/questions/573 ... pplication
 
BartekW
Topic Author
Posts: 53
Joined: 24 Mar 2021, 14:33

Re: Keyboard Navigation - how to make a tree of focusable input?

06 May 2021, 10:41

You want to databind a ContentControl to the a property on the ViewModel. That property will change to whatever should be displayed. Then you define the UserControls as DataTemplates for these types.

https://stackoverflow.com/questions/573 ... pplication
Yee I understand so for my example
-1MainTab
*1SubTab <- generate content in ControlContent

-2MainTab
*1SubTab <- generate content in ControlContent
*2SubTab <- generate content in ControlContent

I will have here 3 view models"
1) for main view model (1MainTab and 2MainTab)
2) for 1MainTab's SubTab's, maybe i will here here more subtabs
3) for 2MainTab's SubTab's

How u think it to make it reusable for another menus?
 
KeldorKatarn
Posts: 193
Joined: 30 May 2014, 10:26

Re: Keyboard Navigation - how to make a tree of focusable input?

06 May 2021, 16:44

It's really hard to describe all the basics here in a short post. I think you need to read up on how the MVVM pattern works. You're trying to implement an advanced navigation without understanding the basics of the architecture yet. I don't think this is the best place for that. Maybe try it in a normal WPF application first?

Here's a tutorial on how to achive navigation like this:

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 90 guests