سؤال

I have the following code to add an LayoutAnchorable to an LayoutAnchorablePane but I don't know how to add a control such as a textbox to a LayoutAnchorable

InitializeComponent();

LayoutAnchorablePane anchorablePane = new LayoutAnchorablePane();

LayoutAnchorable layoutAnchorable = new LayoutAnchorable();

layoutAnchorable.Title = "Dock1";

anchorablePane.Children.Add(layoutAnchorable);

anchorablePaneGroup.Children.Add(anchorablePane);

There are no Children property for LayoutAnchorable that I can see so I can not use the same method.

Edit: From looking at the documentation, this can be done by simply

layoutAnchorable.Content = new TextBox();
هل كانت مفيدة؟

المحلول

To define the content of a LayoutAnchorable you do use the Content property :

Take a look at the documentation : link

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top