Example #1
0
        private void ButPair_Click(object sender, RoutedEventArgs e)
        {
            StringDialog wndPair = new StringDialog("Pairing", "Enter the code you can see on the device and click ok.");

            if (wndPair.ShowDialog().GetValueOrDefault(false))
            {
                _viewModel.Pair(wndPair.Result);
            }
        }
Example #2
0
        private void ButSendMessage_Click(object sender, RoutedEventArgs e)
        {
            StringDialog wndPair =
                new StringDialog("Debug Message", "Enter the message you want to send to the peripheral.");

            if (wndPair.ShowDialog().GetValueOrDefault(false))
            {
                _viewModel.SendMessage(wndPair.Result);
            }
        }
Example #3
0
        private void ButRename_Click(object sender, RoutedEventArgs e)
        {
            Peripheral   p       = (Peripheral)((FrameworkElement)sender).DataContext;
            StringDialog wndPair = new StringDialog("Renaming", "Enter a new name for the device");

            if (wndPair.ShowDialog().GetValueOrDefault(false))
            {
                if (!string.IsNullOrWhiteSpace(wndPair.Result))
                {
                    _viewModel.Rename(p.Id, wndPair.Result);
                }
            }
        }