UnflatLoopValueInjection in Silverlight

Jan 19, 2012 at 11:28 AM

Hi - is UnflatLoopValueInjection supported under Silverlight 4 - or am I just doing something wrong? :)

The code below (taken from the samples page) works in a Console App, but not in Silverlight 4 (Foo1Name and Foo2Name are unflattened, Foo1Foo2Foo1Name is not, nor is Foo1Address).

var flat = new FlatFoo
      {
        Foo1Foo2Foo1Name = "cool",
        Foo1Name = "abc",
        Foo2Name = "123",
        Foo1Address = "6 Street Street"
      };

var unflat = new Foo();
unflat.InjectFrom<UnflatLoopValueInjection>(flat);

  public class Foo
  {
    public Foo Foo1 { get; set; }
    public Foo Foo2 { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }
    public string Address { get; set; }
  }

  public class FlatFoo
  {
    public string Foo1Foo2Foo1Name { get; set; }
    public string Foo1Name { get; set; }
    public string Foo2Name { get; set; }
    public string Foo1Address { get; set; }
    public string Foo1Age { get; set; }
  }

Coordinator
Jan 24, 2012 at 8:25 AM

it wasn't,

please redownload ValueInjecter.Silverlight from the download page, and it will work

Thank You

Jan 24, 2012 at 9:53 AM

Thanks so much for fixing this - you've no idea how much work you've saved me :D