Bläddra i källkod

Fixed little bug

Kenric Nugteren 3 veckor sedan
förälder
incheckning
2c916cabad
1 ändrade filer med 7 tillägg och 3 borttagningar
  1. 7 3
      prs.desktop/Panels/Suppliers/Bills/SupplierBillLineGrid.cs

+ 7 - 3
prs.desktop/Panels/Suppliers/Bills/SupplierBillLineGrid.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Linq;
 using System.Windows;
@@ -25,12 +26,15 @@ public class SupplierBillLineGrid : DynamicOneToManyGrid<Bill, BillLine>
     private static readonly BitmapImage down = PRSDesktop.Resources.green_down_arrow.AsBitmapImage();
 
     private bool OnlyShowProblems = false;
-    private Button ShowProblemsButton;
+    private Button ShowProblemsButton = null!; // Initialised in Init()
 
-    DynamicActionColumn _editColumn;
+    DynamicActionColumn _editColumn = null!; // Initialised in Init()
 
-    public SupplierBillLineGrid()
+    [MemberNotNull(nameof(_editColumn), nameof(ShowProblemsButton))]
+    protected override void Init()
     {
+        base.Init();
+        
         // AddButton("Import", PRSDesktop.Resources.purchase.AsBitmapImage(), ImportLines);
 
         HiddenColumns.Add(x => x.TaxCode.ID);