Sign In|Join
Home/Silverlight.NET Forums/General Silverlight Programming/Programming with .NET - General/Find control position
Last post Oct 19, 2007 06:49 PM by balla
Member
256 Points
112 Posts
Oct 19, 2007 04:54 PM | LINK
Hi,
I've already read it in this forum but I can't find it anymore.
I try to get (and modify) the position of a MediaElement in a Canvas, but how can I get its position ?
Regards.
Participant
1787 Points
557 Posts
Oct 19, 2007 04:59 PM | LINK
Well, if all you want is its position relative to its containing Canvas, all you need is:
mediaElement.GetValue(Canvas.TopProperty);
mediaElement.GetValue(Canvas.LeftProperty);
If you want the position relative to the SilverlightPage, you'll have to use the same code while walking up the control tree.
Oct 19, 2007 05:04 PM | LINK
Thanks.
674 Points
200 Posts
Oct 19, 2007 06:49 PM | LINK
MrCyprom
Member
256 Points
112 Posts
Find control position
Oct 19, 2007 04:54 PM | LINK
Hi,
I've already read it in this forum but I can't find it anymore.
I try to get (and modify) the position of a MediaElement in a Canvas, but how can I get its position ?
Regards.
Brainsonic The Rich Media Factory
jasonxz
Participant
1787 Points
557 Posts
Re: Find control position
Oct 19, 2007 04:59 PM | LINK
Well, if all you want is its position relative to its containing Canvas, all you need is:
mediaElement.GetValue(Canvas.TopProperty);
mediaElement.GetValue(Canvas.LeftProperty);
If you want the position relative to the SilverlightPage, you'll have to use the same code while walking up the control tree.
MrCyprom
Member
256 Points
112 Posts
Re: Find control position
Oct 19, 2007 05:04 PM | LINK
Hi,
Thanks.
Brainsonic The Rich Media Factory
balla
Member
674 Points
200 Posts
Re: Find control position
Oct 19, 2007 06:49 PM | LINK