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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:37:36+00:00 2026-06-13T03:37:36+00:00

I currently create a class which inherits from a Popup . Finally it will

  • 0

I currently create a class which inherits from a Popup.

Finally it will be used to show the user a popup with validation rules when editing e.g a TextBox.

Therefore I created ValidationPopup with this constructor so far:

public ValidationPopup(UIElement parent, double width) : base()
{
   this.parent = parent;
   this.width = width;
   InitControl();
}

I would like to set the size of the popup equal to the size of the PlacementTarget parent.
In order to allow many different controls to be able to have one of these ValidationPopups I pass an UIElement as parent instead of TextBox etc.
My problem is that I have to pass the width and height values of this control when building an instance of ValidationPopup in order to size it properly.

Is it possible to get these values from UIElement?
I saw RenderSize on MSDN but it only gives me 0.0 values for width and height.

This is where I setup one instance of ValidationPopup:

txtOperator = new TextBox();
layoutGrid.Children.Add(txtOperator);
operatorVPU = new ValidationPopup(txtOperator, txtOperator.Width);

I tried to use RenderSize but this doesn’t work until the whole UI is completly finished.

Is there a way to get Height and Width values of an UIElement at this point?
Are there maybe other even better ways to achieve the same result?

  • 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-13T03:37:38+00:00Added an answer on June 13, 2026 at 3:37 am

    Sounds like you need to use the ActualWidth/Height properties. If they are still 0 or NaN, you can try executing this code on a later part of the view creation.

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

Sidebar

Related Questions

I have a class called Projectiles which inherits from CCSprite class, Currently there are
Currently I have a class 'Polygon' which inherits QGraphicsItem. I have class 'PolygonFactory' which
I've created a custom module (which currently only defines a new Exception class), and
I want to create an S4 class in R that will allow me to
Currently I have created a ABCFactory class that has a single method creating ABC
I'm currently experimenting with decorators. I created a Tank class and two decorators: DoubleGunTank
I currently create an object on page load with all possible key/value pairs and
currently i create dynamic database using CreateDatabase() method in Entity Framework. it executes sucessfully
I'm creating an installer for my Windows client application. Currently I create an MSI
Currently I have create a website using codeigniter. I got a message error every

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.