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

  • Home
  • SEARCH
  • 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 3950616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:37:57+00:00 2026-05-20T01:37:57+00:00

I’ve only been working with WPF for a few months, but I have an

  • 0

I’ve only been working with WPF for a few months, but I have an extensive WinForm, ASP.NET, and Flex background. I am attempting to draw a user control which looks like the following IMAGE.

We are using the MVVM pattern. When the user control first loads, everything draws correctly. The control consists of a canvas. Within the canvas exists a radial panel which will geometrically place UIElements which are added. The circular nodes are drawn into the radial panel. The PolyLines shown are drawn in the canvas. I get the end points of the PolyLine by using a GeneralTransform and a call to UIElement.TransformToVisual. Where the UIElement in the call is the blue node in the radial panel and it is transforming with the radial panel. When the control is loaded the first time, everything does draw correctly. Where it fails is when the MVVM pattern informs there is an update to the drawing.

When I attempt to refresh based off the system update, I have confirmed all of my collections contain the proper data. So the MVVM pattern is behaving like it should. However, when I attempt to draw the lines, my call to TransformToVisual is returning a point of 0,0 instead of the value it does during the load. This causes my polylines to draw at the top left of the control instead of connecting the two nodes.

Here is the order of operations:

1) User Control load will build my collections used to draw the control. These collections are built local to the User Control and the data comes from a master collection of info which resides in the view model. The user control registers a refresh method in itself to a UI refresh broadcast message.

2) The user attempts to connect two blue nodes through a wizard. The connector is saved and the refresh UI message is broadcast.

3) The User Control invokes the Refresh method. Here I am looping the children of the canvas and removing the PolyLines. I am also calling radialPanel.Children.Clear. I then perform the same code which built my collections at load. I then invalidate my user control to invoke the OnRender. The OnRender will then attempt to draw the Polylines to connect the nodes. The nodes are always placed properly in the radial panel.

4) The line connecting action is called from the OnRender. Within it I am using the GeneralTransform gt = node.TransformToVisual(radialPanel). This call always returns 0,0 when the user control is “refreshed” but always works the first load for the control.

I’m fairly positive the issue lies with how I refresh the user control based on the network notification. I’ve tried to clear the controls, then re-do the same load operations, but still no luck. I’ve executed InvalidateVisual against the user control and tried to do everything in my overriden OnRender still no luck; 0,0 is still returned.

Does anyone have any ideas on what could be happening to the GeneralTransform? I’m at a dead end and any new path would help.

  • 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-20T01:37:58+00:00Added an answer on May 20, 2026 at 1:37 am

    I figured it out. So I’m posting the answer in case anyone else deals with this issue.

    The problem was I wasn’t forcing MeasureOverride and ArrangeOverride of the radial panel before attempting to draw the lines. Without these two called, the nodes are at position 0,0 at the time I connect my lines. By forcing them to call before drawing the lines, the TransformToVisual works properly.

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

Sidebar

Related Questions

No related questions found

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.