Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs
===================================================================
diff -u -r57517bf1c8e4d95cdd1d1e871891995c16cf94ea -r5973ea19f0223d8e4331d1646e505032a569f0b4
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 57517bf1c8e4d95cdd1d1e871891995c16cf94ea)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 5973ea19f0223d8e4331d1646e505032a569f0b4)
@@ -34,8 +34,6 @@
///
public partial class AssemblyResultTotalView : UserControl, IView
{
- private readonly AssessmentSection assessmentSection;
-
///
/// Creates a new instance of .
///
@@ -49,21 +47,30 @@
throw new ArgumentNullException(nameof(assessmentSection));
}
- this.assessmentSection = assessmentSection;
+ AssessmentSection = assessmentSection;
InitializeComponent();
InitializeDataGridView();
+ SetData();
}
public object Data { get; set; }
+ ///
+ /// Gets the the view belongs to.
+ ///
+ public AssessmentSection AssessmentSection { get; }
+
private void InitializeDataGridView()
{
dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Name), "Toetsspoor", true);
dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Code), "Label", true);
dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Group), "Groep", true);
+ }
- IEnumerable rows = assessmentSection.GetFailureMechanisms()
+ private void SetData()
+ {
+ IEnumerable rows = AssessmentSection.GetFailureMechanisms()
.Select(fm => new FailureMechanismAssemblyResultRow(fm))
.ToList();
dataGridViewControl.SetDataSource(rows);