Skip to content

How to specify parent properties of a control in code behind C# #18050

Answered by rabbitism
SimonORorke asked this question in Q&A
Discussion options

You must be logged in to vote

This is not about parent, but the AttachedProperty system in xaml.

Specific to this question, you can simply call

Canvas.SetTop( yourRectangle, 10);

Notice that this is a static method, the Canvas here is class name, not instance name.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SimonORorke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants