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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:00:54+00:00 2026-05-26T22:00:54+00:00

I have a XAML based ScatterView to which I’m programmatically adding more Scatterviews (

  • 0

I have a XAML based ScatterView to which I’m programmatically adding more Scatterviews (henceforth known as Scatter2s).

Each of the Scatter2s work fine – they each contain ScatterViewItems which in turn contain an Ellipse shape, and these are all drawn to the Surface perfectly as wanted.

In trying to draw lines between two ellipses, I attempt to get the Scatter2.[AScatterViewItem].Center.X and .Y properties, so I can set the X1Y1,X2Y2 properties of the line, but they return as NaN. I’ve also tried ActualCenter which results in the same outcome.

I initially thought it was because I was trying to access these properties before the ellipses were drawn on screen, but I printed the property values after they’ve been drawn and same result.

I checked to ensure that each of the ScatterViewItems width and height are explicitly set before drawing, as are the ellipse width and height – just in case that would throw the calculation of a center property off.

Is there a better way to get the position of a ScatterViewItem which has not been explicitly positioned than using the Center property?

Thanks


In Node:

public void CenterToString()
{
    Console.Out.WriteLine("Actual centre: " + svi.ActualCenter.toString());
    Console.Out.WriteLine("Centre: " + svi.Center.toString());
}

In my main class

Node node_one = ((GeneNetwork) context).getNode(localNodeIds[0]);
node_one.CenterToString();

gives output:

Actual centre to string: NaN,NaN
Centre to string: NaN,NaN

The code which adds a Node to the main ScatterView (context.Items.Add(svi)) is called before the CenterToString() function.

Could it have anything to do with where I’m placing this in my SurfaceWindow class? Currently, everything is in onInitialised(), after the call to base.OnInitialised.

  • 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-26T22:00:54+00:00Added an answer on May 26, 2026 at 10:00 pm

    Center is not set until you set it or user moves the SVI. I would just set it since the SV just places them randomly otherwise. If you really don’t want that you will need to use TransformToAncestor as in Get Absolute Position of element within the window in wpf to get the position of the center of the SVI relative to its parent SV.

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

Sidebar

Related Questions

I have multiple xaml based pages stored as children of a canvas on another
I have a XAML window with multiple TextBoxes, each with a corresponding TextBlock tag
I have a XAML based ContextMenu bound to the rows in a datagrid. It
for reasons based on storabiligty I have the following objects in a XAML graph:
I have two user controls which needs to be loaded dynamically based on a
Suppose I have 3 fields on a Silverlight based xaml page Color, Size and
I have a list on my WPF xaml which contains two items. Below is
I have a .xaml file and a .cs file that share value with Binding.
I have a XAML MenuItem DataBound ItemsSource that is working fine however there is
I have this XAML: <Window x:Class=WpfBindToCodeBehind.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Window1 Height=300 Width=300 Loaded=Window_Loaded> <StackPanel Orientation=Vertical>

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.