from what I can understand, you want to instantiate a Button object (class) with some information, correct?
There are 2 options. The first is to define a constructor that allows you to inject parameters, the second is create the object then set properties with the information you need.
This is how this would look in code;
public class Person
{
// default constructor
public Person()
{
}
public Person(string name, int age)
{
Name = name;
Age = age;
}
public string Name {get;set;}
public int Age {get;set;}
}
public class Employee
{
private Person _person;
// default constructor
// Option 1;
public Employee()
{
// create instance of person injecting name and age on instantiation
Person = new Person("John Doe", "42");
}
// Option 2
public Employee(string name, int age)
{
// create instance with default constructor
Person = new Person();
// set properties once object is created.
Person.Name = name;
Person.Age = age;
}
}
I don't know your programming skills, but if you're new to C#, then check out this link
I hope this helps.