Silverlight Tips provides simple and useful tutorials and tips with real life examples, live demos and sample codes to download.
About authors:
Damon Serji
Damon Serji,
Silverlight developer working at Metia in London.
Gavin Wignall
Gavin Wignall,
Interactive Design Lead, working in design for over 10 years, the last 3 being in Silverlight.
Allan Muller
Allan Muller,
Developer, working on various types of Silverlight and WCF projects.
Recent comments

To set the margin or Canvas of an object from the code you can use SetValue() which is a built-in method. SetValue() takes a DependencyProperty such as a Button, and a double value.


myButton.SetValue(Canvas.LeftProperty, myPoint.X);

In above example ‘myButton’ is a Button on the xaml, and myPoint is a variable of type Point which we use the X value of.

Posted by Damon Serji on 11. January 2010 18:36 under: Basic
 with 0 Comments


Add comment

(Will show your Gravatar icon)

  • Comment
  • Preview