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 8743493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:41:14+00:00 2026-06-13T11:41:14+00:00

I am using C#, Silverlight, Visual Studio for Windows Phone 7. I would like

  • 0

I am using C#, Silverlight, Visual Studio for Windows Phone 7.

I would like to get the Clip of a UIElement that includes any transform that has been done on the UIElement.

This example gives me the Clip but does not include any transform from the UIElement:

// uie is a UIElement taken from a PhoneApplicationPage
Geometry myClip = uie.Clip;

I tried the following, but it ended up moving the UIElement:

var frame = Application.Current.RootVisual as PhoneApplicationFrame;
var page = frame.Content as PhoneApplicationPage;
GeneralTransform gt = uie.TransformToVisual(page);
uie.RenderTransform = gt as Transform;
Geometry myClip = uie.Clip;

I also tried to add an inverse transform at the end to undo any movement, but that seemed to make it worse:

uie.RenderTransform = gt.Inverse as Transform;

Please help me get the Clip with the original transform of the UIElement without messing with the UIElement itself.

Thanks in advance.

  • 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-06-13T11:41:16+00:00Added an answer on June 13, 2026 at 11:41 am

    I figured out how to solve this without messing with the original UIElement. I needed to create a new Geometry object with the same data rather than using the original Geometry. Not only does this separate the new data from the old data, it also prevents an object from possibly getting assigned as a child to multiple objects.

    Here is the resulting code I used:

    var frame = Application.Current.RootVisual as PhoneApplicationFrame;
    var page = frame.Content as PhoneApplicationPage;
    GeneralTransform gt = uie.TransformToVisual(page);
    var place = gt.Transform(new Point());
    // declaring new variables to hold these values
    Geometry geom;
    Path path = new Path();
    // here I checked for other restrictions on my UIElements before assigning the variables
    geom = new RectangleGeometry();
    (geom as RectangleGeometry).Rect = new Rect(place.X, place.Y, uie.RenderSize.Width, uie.RenderSize.Height);
    path.Data = geom;
    

    I mentioned that I check for some restrictions on my UIElements before assigning the variables. This is related to another question I posted about clips (here).

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

Sidebar

Related Questions

I am using C#, Silverlight, Visual Studio for Windows Phone 7. Is there a
I am using C#, Silverlight, Visual Studio for Windows Phone 7. I am interested
I am using C#, Silverlight, Visual Studio for Windows Phone 7. I am looking
While trying to compile a Silverlight project for Windows Phone using Visual Studio 2010
I'm using Silverlight 3 in Visual Studio 2008. Unfortunately I can't seem to get
While working with SilverLight using Visual Studio 10, I found that in design mode
I'm using the Silverlight business application (Navigation application) template that comes with Visual studio
I am using express edition visual studio 2010 for windows phone 7 , 7.1
I'm using the lastest version of Silverlight 2.0 within Visual Studio 2008. I have
I'm using SilverLight on Visual Studio 2008, Ver 3.5 SP1, I have a small

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.