Commit adf7ff8
committed
Centralized key navigation properties to
These were already defined on `INavigationTopicViewModel<T>`, but that _also_ implemented `IHierarchicalTopicViewModel<T>`.
Sometimes, there are topics that should be evaluated for navigation, but which _aren't_ hierarchical, and which _don't_ necessitate the use of e.g. the `IHierarchicalTopicMappingService` or `NavigationViewComponentBase<T>`. For example, offering a list of child topics on a page. In this case, these _may_ implement `IHierarchicalTopicViewModel<T>`, but they only _need_ `Title`, `ShortTitle`, and `WebPath`.
To support this, the `INavigableTopicViewModel` extracts these from the `INavigationTopicViewModel<T>` so they can, optionally, be applied independently. Then, the `INavigationTopicViewModel<T>` effectively becomes a composite of `INavigableTopicViewModel` and `IHierarchicalTopicViewModel<T>`, adding only `IsSelected()`.
This is useful since the view models for the `NavigationTopicViewComponent<T>` are likely going to be independent from other view models, since most view models don't want or need a `Children` collection. But many basic view models will satisfy the `INavigableTopicViewModel` interface, and should be usable for that purpose. This allows different view models types from different chains (e.g., `OnTopic.ViewModels` and a separate customer implementation) to be handled by e.g. the same partial control.INavigableTopicViewModel
1 parent 3e60dea commit adf7ff8
File tree
2 files changed
+51
-22
lines changed- OnTopic/Models
2 files changed
+51
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
41 | 23 | | |
42 | 24 | | |
43 | 25 | | |
| |||
0 commit comments