You can either create a settable property on MyInnerClass
, or give it a constructor that takes a string, as you've done with foo
.
class foo
{
public foo(String txt) : base(new MyInnerClass(txt)) { }
private class MyInnerClass
{
private string text;
public MyInnerClass(string txt)
{
this.text = txt;
}
}
}