예제 #1
0
        private async void DeleteExecute()
        {
            var httpDeleteUrl = string.Format("{0}{1}/{2}", constants.Constants.ServerHostURL, DevicesHttpUrl, this.SelectedDevice.DeviceId);
            var response      = await ServerProvider.Delete(httpDeleteUrl);

            try
            {
                var deviceFromJson = JsonConvert.DeserializeObject <Device>(response);
                this.Devices.RemoveAt(selectedDeviceIndex);
                if (this.SelectedDeviceIndex > 0)
                {
                    this.SelectedDeviceIndex--;
                }
            }
            catch
            {
                Debug.WriteLine("Device deleting failed.");
            }
        }