Reputation: 12861
Here is my code :
<Image x:Name="Layer_22_copy" Height="542" Canvas.Left="16" Opacity="0.522" Source="gammon2_Images\Layer 22 copy.png" Canvas.Top="13" Width="315"/>
how can i change position of this image on Code Behind? i am new in WPF. thank you.
Upvotes: 0
Views: 1905
Reputation: 8763
You can set the Margin Property like
Layer_22_copy.Margin = new Thickness(10, 30, 0, 0);
Upvotes: 1
Reputation: 28637
Layer_22_copy.SetValue(Canvas.TopProperty, newTopValue);
Layer_22_copy.SetValue(Canvas.LeftProperty, newLeftValue);
Upvotes: 2