Esempio n. 1
0
        private static void CopyToClipboard(MeasuredValue m, bool copyValue)
        {
            var d = new DataPackage();

            d.SetText(copyValue ? m.Millimeters + "" : m.Output);
            Clipboard.SetContent(d);
        }
Esempio n. 2
0
        private async void S_ValueChanged(GattCharacteristic sender, GattValueChangedEventArgs args)
        {
            var b = DataReader.FromBuffer(args.CharacteristicValue);

            var bytes = new byte[b.UnconsumedBufferLength];

            b.ReadBytes(bytes);

            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                                                          () =>
            {
                var m = new MeasuredValue(ConvertToMillimeters(bytes));
                _receivedValues.Add(m);
                listViewValues.ScrollIntoView(m);

                UpdateGui();

                if ((bool)beepSwitch.IsChecked)
                {
                    _beep?.Play();
                }
            }
                                                                          );
        }