Coffeehouse Post

Single Post Permalink

View Thread: C# Extension Properties?
  • User profile image

    Exactly. It would be great to have these to get/set WPF attached properties. For Example, instead of writing this:

    DockPanel.SetDock(btn1, Dock.Left);
    DockPanel.SetDock(btn2, Dock.Left);
    DockPanel.SetDock(btn3, Dock.Left);

    You would write this instead:

    btn1.Dock = btn2.Dock = btn3.Dock = Dock.Left;

    Much cooler Cool