void SetDeviceInfoToUI() { int w = sdkLib.getCalibrationWidth(); int h = sdkLib.getCalibrationHeight(); drawCanvas.Height = DRAW_CANVAS_HEIGHT; drawCanvas.Width = DRAW_CANVAS_HEIGHT * ((float)w / (float)h); System.Diagnostics.Debug.WriteLine("canvas w={0} h={1}", drawCanvas.Width, drawCanvas.Height); String audioStr = GetDeviceVoiceLanguage(sdkLib.getAudioLang()); int idx = 0; foreach (ComboBoxItem cx in voiceLang.Items) { if (audioStr.CompareTo(cx.Name) == 0) { voiceLang.SelectedIndex = idx; break; } idx++; } if (sdkLib.getAudioMode() == 0) { SoundSel.SelectedIndex = 0; } else { SoundSel.SelectedIndex = 1; } VolumeSlider.Value = sdkLib.getAudioVolume(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (string.IsNullOrEmpty(rootPage.SelectedBleDeviceId)) { ConnectButton.IsEnabled = false; } if (sdkLib != null) { #if true sdkLib.firePenDataEvent += OnPenDataHandlerAsync; sdkLib.firePenConditionDataEvent += OnPenConditionHandlerAsync; sdkLib.firePenConnectionEvent += OnPenConnectionHandlerAsync; sdkLib.firePenButtonEvent += OnPenButtonHandlerAsync; #endif int w = sdkLib.getCalibrationWidth(); int h = sdkLib.getCalibrationHeight(); drawCanvas.Height = DRAW_CANVAS_HEIGHT; drawCanvas.Width = DRAW_CANVAS_HEIGHT * ((float)w / (float)h); System.Diagnostics.Debug.WriteLine("canvas w={0} h={1}", drawCanvas.Width, drawCanvas.Height); } }