/// <summary> /// Initializes a new instance of the <see cref="SenderViewModel"/> class. /// </summary> /// <param name="senderBluetoothService"> /// The Sender bluetooth service. /// </param> /// public SenderViewModel(ISenderBluetoothService senderBluetoothService) { _senderBluetoothService = senderBluetoothService; ResultValue = "N/D"; SendCommand = new RelayCommand( SendData, () => !string.IsNullOrEmpty(Data) && SelectDevice != null && SelectDevice.DeviceInfo != null); ConnectDevice = new RelayCommand( ConnectBlue, () => SelectDevice != null); Devices = new ObservableCollection <Device> { new Device(null) { DeviceName = "Searching..." } }; Messenger.Default.Register <Message>(this, ShowDevice); //Start thread to keep cheking the connection status Thread trDevConnection = new Thread(CheckDeviceConnection) { IsBackground = true }; trDevConnection.Start(); }
public SendPage() { ISenderBluetoothService service = DependencyService.Get <ISenderBluetoothService>(); SendViewModel viewModel = new SendViewModel(service); this.BindingContext = viewModel; InitializeComponent(); }
/// <summary> /// Initializes a new instance of the <see cref="SenderViewModel"/> class. /// </summary> /// <param name="senderBluetoothService"> /// The Sender bluetooth service. /// </param> public SenderViewModel(ISenderBluetoothService senderBluetoothService) { _senderBluetoothService = senderBluetoothService; ResultValue = "N/D"; SendCommand = new RelayCommand( SendData, () => !string.IsNullOrEmpty(Data) && SelectDevice != null && SelectDevice.DeviceInfo != null); Devices = new ObservableCollection<Device> { new Device(null) { DeviceName = "Searching..." } }; Messenger.Default.Register<Message>(this, ShowDevice); }
public SendViewModel(ISenderBluetoothService senderBluetoothService) { Title = "Send"; _senderBluetoothService = senderBluetoothService; ResultValue = "N/D"; Devices = new ObservableCollection <Device> { new Device(null) { DeviceName = "Searching..." } }; Messenger.Default.Register <Message>(this, ShowDevice); }
public MainViewModel( [NotNull] ISenderBluetoothService service, [NotNull] IUser32 user32, [NotNull] ILog log) { _service = service; _user32 = user32; _log = log; WatchCommand = new RelayCommand(ExecuteWatch); RemoveWatchCommand = new RelayCommand(ExecuteRemoveWatch); StartDiscoverTask(); StartScanning(); }
/// <summary> /// Initializes a new instance of the <see cref="SenderViewModel"/> class. /// </summary> /// <param name="senderBluetoothService"> /// The Sender bluetooth service. /// </param> public SenderViewModel(ISenderBluetoothService senderBluetoothService) { _senderBluetoothService = senderBluetoothService; ResultValue = "N/D"; SendCommand = new RelayCommand( SendData, () => !string.IsNullOrEmpty(Data) && SelectDevice != null && SelectDevice.DeviceInfo != null); Devices = new ObservableCollection <Device> { new Device(null) { DeviceName = "Searching..." } }; Messenger.Default.Register <Message>(this, ShowDevice); }
/// <summary> /// Initializes a new instance of the <see cref="SenderViewModel"/> class. /// </summary> /// <param name="senderBluetoothService"> /// The Sender bluetooth service. /// </param> /// public SenderViewModel(ISenderBluetoothService senderBluetoothService) { _senderBluetoothService = senderBluetoothService; ResultValue = "N/D"; SendCommand = new RelayCommand( SendData, () => !string.IsNullOrEmpty(Data) && SelectDevice != null && SelectDevice.DeviceInfo != null ); ConnectDevice = new RelayCommand( ConnectBlue, () => SelectDevice != null); Devices = new ObservableCollection<Device> { new Device(null) { DeviceName = "Searching..." } }; Messenger.Default.Register<Message>(this, ShowDevice); //Start thread to keep cheking the connection status Thread trDevConnection = new Thread(CheckDeviceConnection) { IsBackground = true }; trDevConnection.Start(); }
public AsynchronousSocketListener() { service = new SenderBluetoothService(); devices = new List <Device>(); }