public MainWindowViewModel(ApplicationManager manager)
{
_manager = manager;
_manager.Error += manager_Error;
_applications = _manager.Applications.ToSyncedSynchronizationContextCollection(x => new ApplicationViewModel(_manager, x), SynchronizationContext.Current);
IsSettingsOpen = new ReactiveProperty<bool>(false);
IsDetailsOpen = new ReactiveProperty<bool>(false);
IsProgressActive = new ReactiveProperty<bool>(false);
ShowWindowRightCommands = IsSettingsOpen.CombineLatest(IsDetailsOpen, (a, b) => !a && !b)
.ToReactiveProperty();
InitialDirectory = _manager.Settings.ToReactivePropertyAsSynchronized(x => x.ApplicationRootDirectoryPath);
ShowHelpCommand = new ReactiveCommand();
ShowHelpCommand.Subscribe(_ => ShowHelp());
RegisterApplicationCommand = IsProgressActive.Select(x => !x).ToReactiveCommand();
RegisterApplicationCommand.Subscribe(_ => RegisterApplication());
InstallApplicationCommand = IsProgressActive.Select(x => !x).ToReactiveCommand();
InstallApplicationCommand.Subscribe(_ => InstallApplication());
OpenSettingCommand = new ReactiveCommand();
OpenSettingCommand.Subscribe(_ => ShowSettings());
ShowDetailsCommand = new ReactiveCommand<ApplicationViewModel>();
ShowDetailsCommand.Subscribe(ShowDetails);
CurrentItem = new ReactiveProperty<ApplicationViewModel>();
SettingsViewModel = new ReactiveProperty<SettingsViewModel>();
}