public BusMonitorControl(UavcanInstance uavcan) { _serializer = uavcan.Serializer; InitializeComponent(); var filter = TableFilterSet.ViewModel; ViewModel = new BusMonitorViewModel(uavcan, filter); this.WhenActivated(disposableRegistration => { this.OneWayBind(ViewModel, vm => vm.Items, v => v.dgFrames.ItemsSource) .DisposeWith(disposableRegistration); this.BindCommand(ViewModel, vm => vm.AddFilter, v => v.AddFilterButton) .DisposeWith(disposableRegistration); this.BindCommand(ViewModel, vm => vm.ClearItems, v => v.ClearButton) .DisposeWith(disposableRegistration); this.Bind(ViewModel, vm => vm.Enabled, v => v.EnabledButton.IsChecked) .DisposeWith(disposableRegistration); }); }
internal LogViewerViewModel(UavcanInstance uavcan, TableFilterSetViewModel filter) { _serializer = uavcan.Serializer; ResolveTypes(uavcan.TypeResolver); var messageReceived = Observable.FromEventPattern <EventHandler <TransferReceivedArgs>, TransferReceivedArgs>( handler => uavcan.MessageReceived += handler, handler => uavcan.MessageReceived -= handler); var logItemsFiller = messageReceived .Select(x => GetLogMessage(x)) .Where(x => x != null) .Subscribe(m => _logItemsSource.Add(m)); var filterObservable = filter.WhenValueChanged(t => t.Filter) .Select(BuildFilter); var sourceBuilder = _logItemsSource .Connect() .Filter(filterObservable) .ObserveOn(RxApp.MainThreadScheduler) .Bind(out _logItems) .Subscribe(); AddFilter = ReactiveCommand.Create(() => filter.AddFilter()); _cleanUp = new CompositeDisposable(logItemsFiller, sourceBuilder, filter); }
public ParametersAccessor(UavcanInstance uavcan, NodeHandle handle) { _uavcan = uavcan; _handle = handle; }
public UIElement CreateUIElement(UavcanInstance uavcan) { return(new BusMonitorControl(uavcan)); }
public UavcanService(TypeResolvingService typeResolvingService) { Engine = new UavcanInstance(typeResolvingService); }
public ParametersService(UavcanInstance uavcan) { _uavcan = uavcan; }