private void NavigationService_Navigated(object sender, NavigationEventArgs e) { // from OnNavigatedFrom IDigitalInkDevice device = AppObjects.Instance.Device; if (device != null) { device.PairingModeEnabledCallback = null; device.DeviceStatusChanged -= OnDeviceStatusChanged; device.Disconnected -= OnDeviceDisconnected; } m_cts.Cancel(); object q = e.Content as RealTimeInkPage; if (q == null) { Frame o = sender as Frame; o.NavigationUIVisibility = NavigationUIVisibility.Hidden; } //Frame.NavigationUIVisibilityProperty = NavigationUIVisibility.Hidden; // from OnNavigatedTo //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; }
private async Task DisplayDevicePropertiesAsync() { //buttonScan.IsEnabled = false; buttonScan.IsEnabled = true; IDigitalInkDevice device = AppObjects.Instance.Device; try { m_propertiesCollection[0].PropertyValue = (string)await device.GetPropertyAsync(SmartPadProperties.DeviceName, m_cts.Token); m_propertiesCollection[1].PropertyValue = (string)await device.GetPropertyAsync(SmartPadProperties.SerialNumber, m_cts.Token); m_propertiesCollection[2].PropertyValue = ((uint)await device.GetPropertyAsync(SmartPadProperties.Width, m_cts.Token)).ToString(); m_propertiesCollection[3].PropertyValue = ((uint)await device.GetPropertyAsync(SmartPadProperties.Height, m_cts.Token)).ToString(); m_propertiesCollection[4].PropertyValue = ((uint)await device.GetPropertyAsync(SmartPadProperties.PointSize, m_cts.Token)).ToString(); m_propertiesCollection[5].PropertyValue = ((uint)await device.GetPropertyAsync(SmartPadProperties.SamplingRate, m_cts.Token)).ToString(); m_propertiesCollection[6].PropertyValue = ((int)await device.GetPropertyAsync(SmartPadProperties.BatteryLevel, m_cts.Token)).ToString() + "%"; } catch (Exception ex) { textBlockStatus.Text = $"Exception: {ex.Message}"; buttonRealTime.IsEnabled = false; buttonScan.IsEnabled = true; } }