Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change propety Canvas.Left and Canvas.Top in codebehind WinRT

<Button x:Name="PlayButton" Content="Play" Canvas.Left="570" Canvas.Top="36" Height="51" Width="202" Background="#FF8898F9" />

How change Canvas.Top and Canvas.Left property of PlayButton in the code?

like image 976
ivamax9 Avatar asked Feb 02 '14 19:02

ivamax9


2 Answers

Canvas class has SetTop and SetLeft static methods that set these attached properties:

Canvas.SetTop(PlayButton, 36);
Canvas.SetLeft(PlayButton, 750);
like image 192
dkozl Avatar answered Oct 14 '22 19:10

dkozl


Canvas.SetLeft(PlayButton, 100);
Canvas.SetTop(PlayButton, 50);
like image 34
Rohit Vats Avatar answered Oct 14 '22 21:10

Rohit Vats