none
What happened to Dock property

    Question

  • I am new to WPF, but I am a Window Forms developer; I have a TreeView I added to a user control, but as the control expands, the TreeView appears anchored bottom left, but I do not see an Anchor property or Dock property; can someone tell me how am I supposed to keep a control where I want (I want docked left or top, either one.

     

    Thank you, sorry if this is WPF 101 question, this is just a different world.

    Friday, June 11, 2010 12:57 PM

Answers

  • Put the TreeView inside a DockPanel and give it the attached DockPanel.Dock="Left" property.
    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    • Marked as answer by Corby Nichols Saturday, June 12, 2010 12:42 AM
    Friday, June 11, 2010 1:18 PM
  • Thank you, that is what I needed, strange the Dock property does not show up in the properties editor but it took it in the "mark up" .xaml, and Visual Studio pickedup on the DockStyle enumeration with intellisense for options for Left Right etc, just seems like the property should be included in the properties editor if the language supports it.

    But thanks anyway, the extensibility for packages is much easier so I guess the trade offs are worth it.

    • Marked as answer by Corby Nichols Saturday, June 12, 2010 12:42 AM
    Saturday, June 12, 2010 12:42 AM

All replies

  • Put the TreeView inside a DockPanel and give it the attached DockPanel.Dock="Left" property.
    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    • Marked as answer by Corby Nichols Saturday, June 12, 2010 12:42 AM
    Friday, June 11, 2010 1:18 PM
  • Thank you, that is what I needed, strange the Dock property does not show up in the properties editor but it took it in the "mark up" .xaml, and Visual Studio pickedup on the DockStyle enumeration with intellisense for options for Left Right etc, just seems like the property should be included in the properties editor if the language supports it.

    But thanks anyway, the extensibility for packages is much easier so I guess the trade offs are worth it.

    • Marked as answer by Corby Nichols Saturday, June 12, 2010 12:42 AM
    Saturday, June 12, 2010 12:42 AM