/// <summary> /// Загрузка списка объектов из базы данных, их отображение в таблице, указание их кол-ва в Label /// </summary> /// <inheritdoc /> public void AdditionalInitializeComponent() { FilterBarCoverLabel.Content = PageLiterals.FilterBarCoverLabel; // Сообщение-заглушка панели фильтрации try { _detailCalculates = DetailCalculatesService.GetAll(); if (_detailCalculates != null && _detailCalculates.Count > 0) { // Критерии сортировки указаны в реализации интерфейса IComparable класса _detailCalculates.Sort(); } PageDataGrid.ItemsSource = _detailCalculates; ShowCountItemsPageDataGrid(); } catch (StorageException ex) { Common.ShowDetailExceptionMessage(ex); } }
/// <summary> /// Событие снятия флага /// </summary> private void checkBox_Unchecked(object sender, RoutedEventArgs e) { var frameworkElement = sender as FrameworkElement; if (frameworkElement == null) { return; } var detailCalculate = frameworkElement.DataContext as DetailCalculate; if (detailCalculate == null) { return; } // Костыль if (!detailCalculate.IsCalculate) { return; } DetailCalculatesService.UpdateIsCalculate(false, detailCalculate); }