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.

  1. If your button is in a canvas panel - then you can Canvas.X and Canvas.Y can set the attribute properties on the button, the desired value.

  2. If your button is in default 1x1 cell grid - you can horizontal alignment = "left" vertical alignment = "set" heading "Margin =" 10,20,0,0 " where 10 and 20 x and y values ​​are.

  3. 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 RenderTransform to create this situation, you give it the original coordinates of 0,0 You can set using one of the earlier methods, set translateTransform to set RenderTransform and set the transform code X And y Properties for the desired values ​​This idea is that the properties of RenderTransform can be easily animated, while Canvas.X / Y or margins are not property because they affect layout and layout calculation is slow.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -