コード例 #1
0
        private async void EditName()
        {
            string name = Name;

            _textEditService.EditText(name, "Edit the text:", "Edit Device Name", t => name = t, t => !string.IsNullOrWhiteSpace(t));

            if (name != Name)
            {
                var result = await _client.RenameDeviceAsync(Id, name);
                await ModelUpdate();
            }
        }
コード例 #2
0
        private async void CreateDevice()
        {
            var viewModel = new CreateDeviceDialogViewModel(Applications);

            if (_viewService.ShowDialog(viewModel) == true)
            {
                var deviceResult = await _client.RegisterDeviceAsync(viewModel.SelectedApplication.Id, Guid.NewGuid().ToString("N"));

                await _client.RenameDeviceAsync(deviceResult.Id, viewModel.Name);

                var newDevice = await _client.GetDeviceAsync(deviceResult.Id);

                Devices.Add(new DeviceViewModel(_tokenProvider, newDevice, _textEditService, _client, _viewService));
            }
        }