-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathViewModelC.cs
More file actions
31 lines (28 loc) · 1.05 KB
/
ViewModelC.cs
File metadata and controls
31 lines (28 loc) · 1.05 KB
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
using Lemon.ModuleNavigation.Abstractions;
using Lemon.ModuleNavigation.SampleViewModel;
using ReactiveUI;
using System;
using System.Reactive;
namespace Lemon.ModuleNavigation.Sample.ModuleCs
{
public class ViewModelC : BaseNavigationViewModel, IModuleNavigationAware, IServiceAware
{
private readonly IModuleNavigationService<IModule> _navigationService;
private readonly IServiceProvider _moduleServiceProvider;
public ViewModelC(IModuleNavigationService<IModule> navigationService,
IModuleServiceProvider moduleServiceProvider)
{
_navigationService = navigationService;
_moduleServiceProvider = moduleServiceProvider;
NavigateCommand = ReactiveCommand.Create<string>(target =>
{
_navigationService.RequestModuleNavigate(target, null);
});
}
public ReactiveCommand<string, Unit> NavigateCommand
{
get;
}
public IServiceProvider ServiceProvider => _moduleServiceProvider;
}
}