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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:03:07+00:00 2026-06-03T05:03:07+00:00

Most converters take no parameters, or one fixed parameter, and are easy to bind

  • 0

Most converters take no parameters, or one fixed parameter, and are easy to bind to:

<local:MyConverter x:Key="MyConverterInstance" />

<TextBox Text="{Binding Path=MyTime, 
                        Converter={StaticResource MyConverterInstance},
                        ConverterParameter='yyyy/MM/dd'}" />

But if I want that format to be a dynamic property that the user can change, I can’t do something like this, right?:

<TextBox Text="{Binding Path=MyTime, 
                        Converter={StaticResource MyConverterInstance},
                        ConverterParameter={Binding Path=UserFormat}}" />

So my only option is to define a DependencyProperty on MyConverter for binding. But my converter definition is a StaticResource. I can’t go

<local:MyConverter x:Key="MyConverterInstance" 
                   Format="{Binding Path=UserFormat}"/>

because there’s no DataContext on StaticResources. How can I set this up?

  • 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-03T05:03:09+00:00Added an answer on June 3, 2026 at 5:03 am

    You cannot bind to a converterparameter but you can use Multibinding instead.
    For example: http://www.switchonthecode.com/tutorials/wpf-tutorial-using-multibindings
    or How to simply bind this to ConverterParameter?

    (Alain) So just to translate that linked answer into something that matches this question:

    <TextBlock>
        <TextBlock.Resources>
            <local:MyConverter x:Key="MyConverterInstance" />
        </TextBlock.Resources>
        <TextBlock.Text>
            <MultiBinding Converter="{StaticResource converter}">
                <Binding Path="MyTime" />
                <Binding Path="UserFormat" />
            </MultiBinding>
        </TextBlock.Text>
    </TextBlock>
    
    public class MyConverter : IMultiValueConverter
    {
      public object Convert(object[] values, Type targetType, object parameter,
          System.Globalization.CultureInfo culture)
      {
        DateTime time = (DateTime)values[0];
        string format = values[1].ToString();
        return time.ToString(format);
      }
    
      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'm stumped with this one and your help would be most appreicated. I get
So I've got an object that has an observable collection. Most places I bind
Most web pages are normally parsed and of course I don't see tags like
Most forums do not specify any default value for the ID column. I wonder
Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever,
Most of time we represent concepts which can never be less than 0. For
Most program languages have some kind of exception handling; some languages have return codes,
Most mature C++ projects seem to have an own reflection and attribute system ,
Most of the implementations I find require a hardware instruction to do this. However
Most of the MVC samples I have seen pass an instance of the view

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.