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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:05:28+00:00 2026-05-20T20:05:28+00:00

I’ve got a fairly common situation in my Silverlight UI where the Visibility of

  • 0

I’ve got a fairly common situation in my Silverlight UI where the Visibility of various elements is bound to some property on the ViewModel. For instance, I may have a control like this:

<myapp:WarningView Visibility="{Binding IsInWarningState}" />

If the warning state is true, we want to show the control, if not, we don’t. The problem is that I’ve got many situations where the page renders and displays all the content, including the WarningView control, and then a second later hides the view, which looks really clumsy.

I think what’s happening is that the View loads and makes an async call to the server to get the data, but until that happens, there’s no DataContext and so nothing for the WarningView to bind to, and uses defaults, and the default is to show the control.

It seems cleanest for the view to instantiate its own view model, or at least that’s what I’m doing now. And since the call is async, there could always be some interval when you want to be showing something but you don’t have the real data to show yet. I could imagine making a mock ViewModel with better defaults, but that seems like a lot of work to do project wide.

So what’s the best way around this problem?

  • 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-20T20:05:28+00:00Added an answer on May 20, 2026 at 8:05 pm

    Well, long after I gave up on this, I stumbled across the answer myself: in the binding you can specify a FallbackValue and/or TargetNullValue, which specify a value to use when the thing you’re binding to can’t be obtained or is null. My problem was that the View loads and creates the ViewModel, and for the instant between when the View is visible and when the binding is complete, the controls are visible, and then the binding collapses them, and this causes the flicker. By setting Fallback values, I can make sure that the controls are Collapsed, and then turn on only when bound, and then they stay on. No flicker.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
i got an object with contents of html markup in it, for example: string
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.