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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:14:55+00:00 2026-05-25T03:14:55+00:00

Given that we have the following View: <StackPanel> <TextBlock Text=Some text/> <Image Source={Binding vmImageProp}

  • 0

Given that we have the following View:

<StackPanel>

<TextBlock Text="Some text"/>
<Image Source="{Binding vmImageProp}" Height="10" Visibility="{Binding vmImageVisProp}" />

<StackPanel/>

At startup, when the ViewModel is initialized and bound to the View, the vmImageVisProp is set to Collapsed. It is correct, I don’t need to reserve space for a hidden image.

At some point of application execution a logic tells the VM to make the Image visible. If I just set the vmImageVisProp property to Visible, my StackPanel will re-size momentarily, creating a not desired jumpy effect.

But I want to animate a smooth re-size of the StackPanel, and then, when the blank space is ready, the image will appeare there.

I know how to have a sequence of animations for this.

What I don’t know, is how to work around an unknown final size of the StackPanel. I need to know it in order to tell the animation of how big the value of StackPanels’ height should get.

I know that the stack panels’ height should increase by 10 (the height of the appearing image), but when I define an animation, I need to explicitly set the resulting height on the stackPanel.

Since I am to execute an animation from a ViewModel code, I could have calculated it on the fly, but I am not aware of how to get the Height of a StackPanel, since the viewModel knows nothing of it.

What is the correct way to animate such an image insertion?

  • 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-25T03:14:55+00:00Added an answer on May 25, 2026 at 3:14 am

    In case anyone needs a solution for future reference:

    I have found this blog article:
    http://dotnetbyexample.blogspot.com/2011/01/viewmodel-driven-animations-using.html

    It shows how I can use ViewModel driven animation using the features in Visual State Manager.

    Exactly what I needed.

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

Sidebar

Related Questions

Given that I have the following widget (and a view attached to it): public
I have the following php script that allows me perform some calls to other
I have created some code that emails an html email to a given address.
Imagine I have the following: inFile = /adda/adas/sdas/hello.txt # that instruction give me hello.txt
I have a function that gives me the following warning: [DCC Warning] filename.pas(6939): W1035
Given that I only have one monitor, what's the best way to debug a
What alternatives are there to GAE, given that I already have a good bit
I have just started migrating my homegrown persistence framework to JPA. Given that the
I have a <table/> in a ViewUserControl that I have given the tag a
I have noticed that regardless of a given script's execution time, every date() call

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.