Example #1
0
        public ServiceInfo()
        {
            this.InitializeComponent();   // default init for page object

            // Handle back button press
            this.Loaded += (sender, e) => { HardwareButtons.BackPressed += OnBackPressed; };
            // De-register back button when the page is no longer visible
            this.Unloaded  += (sender, e) => { HardwareButtons.BackPressed -= OnBackPressed; };
            ServiceVM       = new BEServiceVM();
            Characteristics = new BECharacteristicListVM();
            DeviceVM        = new BEDeviceVM();
        }
        public DeviceInfo()
        {
            this.InitializeComponent();   // default init for page object

            // Handle back button press
            this.Loaded += (sender, e) => { HardwareButtons.BackPressed += OnBackPressed; };
            // De-register back button when the page is no longer visible
            this.Unloaded += (sender, e) => { HardwareButtons.BackPressed -= OnBackPressed; };

            // Create initial instances of page objects
            DeviceVM   = new BEDeviceVM();
            ServicesVM = new BEServiceListVM();
        }
        private void OnDeviceSelectionChanged(object sender, RoutedEventArgs e)
        {
            ListBox listBox = (ListBox)sender;

            if (listBox.SelectedIndex == -1)
            {
                return;
            }

            foreach (var listBoxItem in listBox.SelectedItems)
            {
                BEDeviceVM device = listBoxItem as BEDeviceVM;
                GlobalSettings.SelectedDevice = device.DeviceM;
            }
            this.Frame.Navigate(typeof(DeviceInfo));
        }