Wednesday 2 June 2010

Silverlight page dragging

Silverlight page need a container to show. As a container we use grid or border basically. But grid has predefined fixed position. So .xaml page is not drag able if we use grid. Border also have problem for dragging. To use .xaml page as like pop up window and to easily drag thought the pages we can use canvas as container.

In .xaml file paste above line. In .cs file paste following line.

canvas.Children.Add(object);

To make position of object we can define a margin for it.

object.Margin = new Thickness(200, 150, 2, 2);

No comments:

Post a Comment