Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4076266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:24:10+00:00 2026-05-20T17:24:10+00:00

I have a UIElement that has various transformations performed on it (scale and translate).

  • 0

I have a UIElement that has various transformations performed on it (scale and translate).

Is there a way to get the UIElement’s position after transformation? I tried GetValue(Canvas.TopProperty) but it doesn’t change from what it was loaded as.

I must be missing something obvious but not sure what. (I’m using silverlight)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:24:11+00:00Added an answer on May 20, 2026 at 5:24 pm

    It is a little bit unintuitive to do this, but it can be done. It is a two step process. First, what you want to use the TransformToVisual function (from MSDN):

    Returns a transform object that can be used to transform coordinates from the UIElement to the specified object.

    TransformToVisual will yield a GeneralTransform that will perform the transformation from any UIElement to any other UIElement (given that they both exist in the same visual tree). It sounds like what you want is the transformation from the RootVisual.

    var transform = Application.RootVisual.TransformToVisual(myUiElement);
    

    The transform object is now a general transformation that can be used to transform anything in the same way that myUiElement was transformed relative to RootVisual

    The next step is to transform a point using that transformation.

    var myUiElementPosition = transform.Transform(new Point(0,0));
    

    The myUiElementPosition is now a Point that has been transformed and should be the position of the UIElement you’re looking for. new Point(0,0) is used because I assume you want to have the position given relative to the top left corner of the RootVisual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scrollview control that has a StackPanel (Orientation=Vertical) UI Element inside of
I have written a simple class that works with a UIElement and an action
I have created a new UIElement that derives from Systen.Windows.Controls.Canvas. I am trying to
I have a window that has a menu, a toolbar at the top, and
I have a custom login usercontrol that has a normal textbox and a passwordbox.
I have an application that has menu keyboard shortcuts and text boxes. I want
I have a sqlite database that has over 2000 low res thumbnails of pictures.
I have an app that has a rather large help section in PDF form.
As suggested I allow all of my WPF UIElement s to have a dynamic
In Silverlight 3.0 I have added a custom behavior to some UIElement in Code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.