Skip to content

Commit 89ab030

Browse files
committed
Introduced NavigationTopicViewModel
The `NavigationTopicViewModel` is meant to provide a concrete implementation of the `INavigationTopicViewModelCore`, as a wrapper around the `IPageTopicViewModelCore` (i.e., in context of this project, the `PageTopicViewModel`).
1 parent 126038c commit 89ab030

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

Ignia.Topics.ViewModels/Ignia.Topics.ViewModels.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<Compile Include="IndexTopicViewModel.cs" />
4848
<Compile Include="ItemTopicViewModel.cs" />
4949
<Compile Include="LookupListItemTopicViewModel.cs" />
50+
<Compile Include="NavigationTopicViewModel.cs" />
5051
<Compile Include="PageGroupTopicViewModel.cs" />
5152
<Compile Include="PageTopicViewModel.cs" />
5253
<Compile Include="Properties\AssemblyInfo.cs" />
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia
4+
| Project Website
5+
\=============================================================================================================================*/
6+
7+
using System.Collections.ObjectModel;
8+
9+
namespace Ignia.Topics.ViewModels {
10+
11+
/*============================================================================================================================
12+
| VIEW MODEL: NAVIGATION TOPIC
13+
\---------------------------------------------------------------------------------------------------------------------------*/
14+
/// <summary>
15+
/// Provides a strongly-typed data transfer object for feeding views with information about the navigation.
16+
/// </summary>
17+
/// <remarks>
18+
/// No topics are expected to have a <c>Navigation</c> content type. Instead, this view model is expected to be manually
19+
/// constructed by e.g. a <c>LayoutController</c>.
20+
/// </remarks>
21+
public class NavigationTopicViewModel : PageTopicViewModel, INavigationTopicViewModelCore {
22+
23+
public Collection<INavigationTopicViewModelCore> Children { get; set; }
24+
public bool IsSelected(string uniqueKey) => uniqueKey?.StartsWith(this.UniqueKey) ?? false;
25+
26+
} // Class
27+
28+
} // Namespace

0 commit comments

Comments
 (0)