コード例 #1
0
        private void ConfirmDeleteTimeZone()
        {
            DispatcherHelper.CheckBeginInvokeOnUI(() =>
            {
                string message = "";
                try
                {
                    _timeZoneRepo.Delete(SelectedTimeZoneViewModel.CurrentTimeZone.TimeZoneID);
                    message = "删除时间区成功!";

                    TimeZoneViewModels.Remove(SelectedTimeZoneViewModel);
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    message = "删除时间区失败!";
                }
                Messenger.Default.Send(new NotificationMessage(message), Tokens.TimeZonePage_ShowNotification);
            });
        }