windows runtime - Win RT how to place button in specific coordinates? -
I am trying to put a button in a special x and y values. Is it possible in Metro C # (Windows Store app)
You have two main options and one Less is obvious.
-
If your button is in a
canvaspanel - then you canCanvas.XandCanvas.Ycan set the attribute properties on the button, the desired value. -
If your button is in default 1x1 cell
grid- you canhorizontal alignment = "left" vertical alignment = "set" heading "Margin =" 10,20,0,0 "where 10 and 20 x and y values are. -
If you want to animate the coordinates (one With button is not normal, but who am I to judge) - It is best to use a
RenderTransformto create this situation, you give it the original coordinates of 0,0 You can set using one of the earlier methods, settranslateTransformto setRenderTransformand set the transform codeXAndyProperties for the desired values This idea is that the properties ofRenderTransformcan be easily animated, whileCanvas.X / Yormarginsare not property because they affect layout and layout calculation is slow.
Comments
Post a Comment