public AnalysisViewModel(NamingServiceManager maanger) { _manager = _manager; var isCreating = new SignalNotifier(); // nullではないAnalyzerがセットされたら更新実行が可能 UpdateCommand = Observable .FromEventPattern<PropertyChangedEventArgs>(this, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "Analyzer") .Select(_ => _Analyzer != null) .Merge(isCreating.Select(x => x == SignalChangedStatus.Empty)) .ToReactiveCommand(false); Items = UpdateCommand .SelectMany(_ => AnalyzeAsync(isCreating)) .Do(_ => Items.ClearOnScheduler()) .SelectMany(_ => _) .ToReactiveCollection(); }
public AnalysisViewModel(NamingServiceManager maanger) { _manager = _manager; var isCreating = new SignalNotifier(); // nullではないAnalyzerがセットされたら更新実行が可能 UpdateCommand = Observable .FromEventPattern <PropertyChangedEventArgs>(this, "PropertyChanged") .Where(e => e.EventArgs.PropertyName == "Analyzer") .Select(_ => _Analyzer != null) .Merge(isCreating.Select(x => x == SignalChangedStatus.Empty)) .ToReactiveCommand(false); Items = UpdateCommand .SelectMany(_ => AnalyzeAsync(isCreating)) .Do(_ => Items.ClearOnScheduler()) .SelectMany(_ => _) .ToReactiveCollection(); }
public SearchRecordWindowViewModel(Action<RecordDescription> notifier, string dataType=null, string componentType=null, string portName=null) { _recordDescriptionRepository = RepositoryFactory.CreateRepository(); _notifier = notifier; // 検索中は検索ボタンが押せないようにする var isSearching = new SignalNotifier(); SearchCommand = isSearching.Select(x=>x == SignalChangedStatus.Empty).ToReactiveCommand(); // 検索ボタンが押されたら検索処理を非同期で実行し、その結果をSearchResultsに入れる SearchResults = SearchCommand.SelectMany(_ => SearchAsync(isSearching)) .Do(_ => SearchResults.ClearOnScheduler()) .SelectMany(_ => _) .Select(r => new SearchResultViewModel(r, NotifyAdopt)) .ToReactiveCollection(); Initialize(dataType, componentType, portName); SearchCommand.Execute(null); }
public SearchRecordWindowViewModel(Action <RecordDescription> notifier, string dataType = null, string componentType = null, string portName = null) { _recordDescriptionRepository = RepositoryFactory.CreateRepository(); _notifier = notifier; // 検索中は検索ボタンが押せないようにする var isSearching = new SignalNotifier(); SearchCommand = isSearching.Select(x => x == SignalChangedStatus.Empty).ToReactiveCommand(); // 検索ボタンが押されたら検索処理を非同期で実行し、その結果をSearchResultsに入れる SearchResults = SearchCommand.SelectMany(_ => SearchAsync(isSearching)) .Do(_ => SearchResults.ClearOnScheduler()) .SelectMany(_ => _) .Select(r => new SearchResultViewModel(r, NotifyAdopt)) .ToReactiveCollection(); Initialize(dataType, componentType, portName); SearchCommand.Execute(null); }