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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:51:51+00:00 2026-05-18T21:51:51+00:00

I was looking to bind a timespan property to a textblock,which seems to be

  • 0

I was looking to bind a timespan property to a textblock,which seems to be resolved with
the help of this post

Now i want to hide StringFormat when data is null.From the thread if i use a mutibinding with a stringformat and if my data is null then the stringformat displays just a “:”

<TextBlock>
    <TextBlock.Text>
        <MultiBinding StringFormat="{}{0}:{1}">
            <Binding Path="MyTime.Hours" TargetNullValue={x:Null}/>
            <Binding Path="MyTime.Minutes" TargetNullValue={x:Null}/>
        </MultiBinding>
    </TextBlock.Text>
</TextBlock>

How could i hide the “:” if data is null

  • 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-18T21:51:51+00:00Added an answer on May 18, 2026 at 9:51 pm

    I’m basically answering the same thing as Nicolas Repiquet here but anyway..
    It feels like there is a part missing in the framework here. There is no way (as far as I know) to make a MultiBinding use a FallbackValue without a Converter. Using this approach will probably set you back to square 1 since your last question was about a better approach then using a Converter 🙂

    <TextBlock>
        <TextBlock.Text>
            <MultiBinding StringFormat="{}{0}:{1}"
                          Converter="{StaticResource FallbackConverter}"
                          FallbackValue="">
                <Binding Path="MyTime.Hours" />
                <Binding Path="MyTime.Minutes" />
            </MultiBinding>
        </TextBlock.Text>
    </TextBlock>
    

    And the Converter basically does what you “should” be able to use a Property for

    public class FallbackConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            foreach (object value in values)
            {
                if (value == DependencyProperty.UnsetValue)
                {
                    return DependencyProperty.UnsetValue;
                }
            }
            return values;
        }
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am basically looking to bind a search query to a gridview which is
I'm looking for something similar to C++'s boost::bind but in C. What I want
I'm looking for a way to bind a datatemplate which is in a resource
I'm looking at JQuery Tiny Pub/Sub, which looks something like this: (function($){ var o
I'm new to c# and I'm looking for a way to bind a property
I'm looking to find the Javascript Event I need to put into jQuery's .bind
Looking to do a bit of refactoring... Using NHibernate I have this query currently
Looking for best advice on how to do this: I have an insert like
Specifically I'm looking to bind lightbox to a specific element. Normally I would just
I am looking for a way to bind a collection on the server side,

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.