示例#1
0
 public GaugeViewModel(ServoDriveService servoDriveService)
 {
     _servoDriveService = servoDriveService;
     _servoDriveService.PropertyChanged += (sender, e) =>
     {
         RaisePropertyChanged(e.PropertyName);
     };
 }
示例#2
0
 /// <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));
 }
示例#3
0
 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();
     //};
 }
示例#4
0
 /// <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;
 }
示例#5
0
        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);
            });
        }