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 to change Canvas.Top and Canvas.Left property in PlayButton in code?

+7
c # wpf winrt-xaml canvas xaml
source share
2 answers

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

 Canvas.SetTop(PlayButton, 36); Canvas.SetLeft(PlayButton, 750); 
+16
source share
 Canvas.SetLeft(PlayButton, 100); Canvas.SetTop(PlayButton, 50); 
+4
source share

All Articles