-
Is there a manual way to instance a var uc = new UserControl() {
Content = new TextBox() {
Text = "TEST"
}
};
uc.InitializeComponent();
uc.ApplyTemplate();
uc.Measure(Size.Infinity);
uc.Arrange(new Rect(uc.DesiredSize));
// This is always empty
uc.GetVisualChildren(); What is the proper way to instance a control? If there is no way to do this, then that is something I need to know. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You should be able to create a simple Window without showing it, to be able to render content. It will work as an actual root for your control. |
Beta Was this translation helpful? Give feedback.
You should be able to create a simple Window without showing it, to be able to render content. It will work as an actual root for your control.