using System; public class Test { struct Foo { public int A {get;set;} public void SetA(int a) { A = a; } } class Bar { Foo f; public Foo F {get{return f;} set {f = value;}} public void SetFooA(int x) { f.SetA(x); } } public static void Main() { Bar b = new Bar(); b.F.SetA(123); Console.WriteLine("{0}", b.F.A); b.SetFooA(456); Console.WriteLine("{0}", b.F.A); b.F = new Foo { A = 112233 }; Console.WriteLine("{0}", b.F.A); } }