Cuong Me

Cuong Me

  • NA
  • 8
  • 376

Inheritance and Generics? Factory class?

Oct 24 2019 4:52 AM
I have a grid class (will remove most of the properties to  keep it short)
 
 public class WinGrid
{
 
    public List<WinGridRow> Rows 
  {
     ... 
  } 
 
 
public class WinGridRow
{
 
 
   public WinGridRow(WinGrid parent) 
    {
       // Many properties and methods
    }
 
Basically I want to inherit the Grid class but the Rows property returns a list of GridRow. The GridRow class does what I what to do but I want to inherit it and add more specific methods and properties. I what to know the best approach and to go about it. Generics? Factory? 
 
Any help will be appreciated.
 
Thanks 
 

Answers (6)