Exemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            //MainPage = new VerImagePage();
            MainPage = new DevicesPage();
        }
Exemplo n.º 2
0
        public DevicesPageViewModel(DeviceModel dm, DevicesPage view)
        {
            _dm   = dm;
            _view = view;

            _devices = new ObservableViewCollection <TargetDevice, DeviceViewModel>(_view.Dispatcher);
            _devices.ViewMap.Add(typeof(MfTargetDevice), typeof(MfTargetDeviceViewModel));
            _devices.ViewMap.Add(typeof(FirmataTargetDevice), typeof(FirmataTargetDeviceViewModel));
            _devices.CollectionChanged += _devices_CollectionChanged;
        }
        public DevicesPageViewModel(DeviceModel dm, DevicesPage view)
        {
            _dm = dm;
            _view = view;

            _devices = new ObservableViewCollection<TargetDevice, DeviceViewModel>(_view.Dispatcher);
            _devices.ViewMap.Add(typeof(MfTargetDevice), typeof(MfTargetDeviceViewModel));
            _devices.ViewMap.Add(typeof(FirmataTargetDevice), typeof(FirmataTargetDeviceViewModel));
            _devices.CollectionChanged += _devices_CollectionChanged;
        }
 private void DevicesOnClick(object sender, EventArgs e)
 {
     using (DevicesPage devicesWindow = new DevicesPage(bluetoothServer, devices))
     {
         Dictionary <string, string> pairedDevice;
         if (devicesWindow.ShowDialog() == DialogResult.OK)
         {   // Dialog returns at least a subset of the devices initially provided in the form constructor.
             initialSetupButton.Enabled = false;
             pairedDevice = devicesWindow.KnownDevices;
             devices      = pairedDevice;
         }
         MessageProcessor.InitialSetup = false;
         bluetoothServer.ResetProtocolStack();
         devicesWindow.Dispose();
     }
 }
 public string GetDevicesPageHeader()
 {
     Step("Get page header");
     return(DevicesPage.GetPageHeader());
 }