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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:59:55+00:00 2026-05-12T13:59:55+00:00

I have a grid/canvas that has an element (say an icon with an image

  • 0

I have a grid/canvas that has an element (say an icon with an image and text overlayed) added to it dynamically via code.

Most of the time it renders correctly when added (content is aligned properly inside it),
but sometimes all the content sits in one corner.

I can remove/add/remove/add/remove/add and it will eventually do it

After a movement of the parent canvas, the element corrects itself as if the layout has been updated.

I have tried the following on Loaded and OnApplyTemplate for both the element and the element parent but it still seems to happen occasionally

  • InvalidateMeasure()
  • InvalidateArrange()
  • UpdateLayout()

Any ideas on why the content wouldn’t arrange would be appreciated cause its driving me nuts

  • 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-12T13:59:55+00:00Added an answer on May 12, 2026 at 1:59 pm

    I’m not sure why it works for you sometimes but not others. But a grid has the inherent ability to dynamically resize itself and its contents. A canvas doesn’t (you’d have to handle that manually in code).

    If you change your canvas to a grid does it work? A grid has slightly more overhead than a canvas but it sounds to me like you need its functionality anyway.

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

Sidebar

Related Questions

I have a user control that has a grid (the one you get automatically
I have a small WPF application, which has a Canvas and a Grid. I
I have a Grid inside a Canvas defined like this: <Canvas x:Name=outerCanvas> <Grid Grid.Row=1
I have grid with some textboxes and an image which goes out of grid
I have grid of images, when the mouse is over any given image a
I am using vb.net code. I have grid view, please see the code below:
I am developing a GUI that has a canvas and a bunch of controls
In my Canvas, I have an image object. I haven't set a source in
In my application I have a Grid that is divided in two columns: instance_room[room_guid].Room_grid.ColumnDefinitions.Add(new
I have a Canvas that contains a button which I want to be able

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.