Esempio n. 1
0
        private void PromptBluetoothOptions(IEnumerable <BluetoothDeviceModel> pairedDevices)
        {
            if (pairedDevices == null)
            {
                pairedDevices = new List <BluetoothDeviceModel>();
            }

            pairedDevices = pairedDevices.Append(BluetoothDeviceModel.GetDemoDevice());

            // specify an adapter
            var adapter = new BluetoothDeviceAdapter(pairedDevices);

            adapter.ItemClick += async(s1, arg1) =>
            {
                await ViewModel.GetDiagnosticDevice(arg1.DeviceAddress);
            };

            DeviceRecyclerView.SetAdapter(adapter);

            ConnectingLayout.Visibility      = Android.Views.ViewStates.Gone;
            DeviceSelectionLayout.Visibility = Android.Views.ViewStates.Visible;
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser;

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.DeviceSelection);

            var layoutManager = new LinearLayoutManager(this);

            DeviceRecyclerView.SetLayoutManager(layoutManager);

            ViewModel = ContainerManager.Container.Resolve <IMainViewModel>();

            //Do this here, because it does not always restore
            if (bundle != null)
            {
                RestoreValues(bundle);
            }
        }