Run different code based type c# : I want to call a method for my WPF-App with subtype objects of my *Piece* class. My problem is that the subtype objects got more properties than e.g the the *Text* objects. Do you know a way to coupe with this better than I do in my *FillForm* example?

    namespace Namespace
    {
        public abstract class Piece
            {
                public int id { get; set; }
                public string title { get; set; }
                public string description { get; set; }
        
            }
        
            public class Text : Piece
            {
        
            }
        
            public class Image: Piece{
                 public string filePath { get; set; }
                public string fileformat { get; set; }
            }
        
            public class Video : Image
            {
                
            }   
        }
    }

Example method:

    public void FillForm(Piece currentPiece)
    {    
                pieceIdTextBox.Text = currentPiece.id.ToString();
                pieceNameTextBox.Text = currentPiece.title;
                pieceDescriptionTextBox.Text = currentPiece.description;
                if (!currentPiece.GetType().ToString().Equals("Namespace.Text"))
                {
                    pieceFileSelectURLTextBlock.Text = (currentPiece as Namespace.Image).filePath;
                    SetPreviews((currentPiece as Namespace.Image).filePath);
                }
    
    }

Thanks!