コード例 #1
0
        private async Task Edit(Guid id)
        {
            try
            {
                IsBusy = true;

                var selectedDrive = DriveList.Single(x => x.DriveId == id);

                if (selectedDrive.State == Enums.Status.Created)
                {
                    await _navigationService.NavigateAsync <EditDriveViewModel>(selectedDrive);
                }
                else
                {
                    await _navigationService.NavigateAsync <DriveViewModel>(selectedDrive);
                }
            }
            catch (Exception ex)
            {
                await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }