public GaugeViewModel(ServoDriveService servoDriveService) { _servoDriveService = servoDriveService; _servoDriveService.PropertyChanged += (sender, e) => { RaisePropertyChanged(e.PropertyName); }; }
/// <summary> /// Initializes a new instance of the <see cref="SettingViewModel" /> class /// </summary> public ConfigurationViewModel(ServoDriveService servoDriveService) { _servoDriveService = servoDriveService; _servoDriveService.PropertyChanged += (sender, e) => RaisePropertyChanged(nameof(e.PropertyName)); RaisePropertyChanged(nameof(BatteryConfiguration)); RaisePropertyChanged(nameof(CoreConfiguration)); RaisePropertyChanged(nameof(PedalConfiguration)); RaisePropertyChanged(nameof(ThrottleConfiguration)); }
public DiagnosticViewModel(IUserDialogs dialogs, ISerializer serializer, SqliteConnection connection, ServoDriveService servoDriveService) : base(dialogs) { this.serializer = serializer; this.connection = connection; this.servoDriveService = servoDriveService; //servoDriveService.FaultChanged += (sender, e) => //{ // LoadCommand.Execute(); //}; }
/// <summary> /// Initializes a new instance of the <see cref="SettingViewModel" /> class /// </summary> public LiveDataLogViewModel(ServoDriveService servoDriveService, DataTransport <Packet> dataTransport) { _servoDriveService = servoDriveService; this.dataTransport = dataTransport; _servoDriveService.PropertyChanged += (sender, e) => RaisePropertyChanged(e.PropertyName); channel = dataTransport.Channels.FirstOrDefault(); if (channel != null) { channel.DataReceived += ServoViewModel_DataReceived; } ((INotifyCollectionChanged)dataTransport.Channels).CollectionChanged += ServoViewModel_CollectionChanged; }
public MainViewModel(INavigationService navigationService, ServoDriveService servoDriveService, IUserDialogs dialogs, IContainerRegistry containerRegistry) { this.navigationService = navigationService; this.dialogs = dialogs; this.containerRegistry = containerRegistry; ServoDriveService = servoDriveService; servoDriveService.IsOpenChanged += (sender, e) => { if (servoDriveService.IsOpen) { this.dialogs.Toast("Bluetooth is Connected"); } else { this.dialogs.Toast("Bluetooth is Disconnected"); } }; Task.Run(async() => { await Task.Delay(300); }); }