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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:14:59+00:00 2026-05-28T05:14:59+00:00

I am able to bind my datasource to the textblock for the display text.

  • 0

I am able to bind my datasource to the textblock for the display text. However I would like to set the Fontweight to bold if the value of the checkbox foo is checked. I’m trying to use IMultiValueConverter to accomplish this, but have had no luck so far. Any idea as to what I’m doing wrong?

<CheckBox Name="foo"/>
<TextBlock Name="bar" Text="{Binding Path=Name}">
    <TextBlock.FontWeight>
        <MultiBinding Converter="{StaticResource FontConverter}">
            <Binding RelativeSource="{RelativeSource self}" Path="???"/>
            <Binding ElementName="???" />
        </MultiBinding>
    </TextBlock.FontWeight>
</TextBlock>

and the converter class (just hardwired to always return bold for now)

Public Class FontConverter
    Implements IMultiValueConverter

    Public Function Convert(values() As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IMultiValueConverter.Convert
        Return "Bold"
    End Function

    Public Function ConvertBack(value As Object, targetTypes() As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object() Implements System.Windows.Data.IMultiValueConverter.ConvertBack
        Return nothing
    End Function
End Class
  • 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-28T05:15:00+00:00Added an answer on May 28, 2026 at 5:15 am

    If you want to use a converter you should bind to the CheckBox.IsChecked ({Binding IsChecked, ElementName=foo}), you do not need a MultiBinding, then in Convert cast the value to bool and based on that either return normal or bold (preferably as an actual FontWeight, not a string).

    Here however i would recommend a DataTrigger on IsChecked.

    e.g.

    <TextBlock Text="{Binding Name}">
        <TextBlock.Style>
            <Style TargetType="TextBlock">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsChecked, ElementName=foo}"
                                 Value="true">
                        <Setter Property="FontWeight" Value="Bold"/>
                    </DataTrigger >
                </Style.Triggers>
            </Style>
        </TextBlock.Style>
    </TextBlock>
    

    (Also note dependency property precedence, if you set the FontWeight locally the trigger will no do anything)

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

Sidebar

Related Questions

I would like to be able to programmatically bind some data to the dependency
I have a gridview that I would like to be able to bind to
Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0); texture.bind(); I am able to bind 1 texture like this... But if I
I am able to bind a MyDictionary.Value to a ComboBox and see the Values
In WPF and SubSonic 2 using Active Record, I was able to bind to
anyone able to tell me how often a materialized view is set to refresh
i am not sure if my design have flaw but would like to know
I've noticed that in .Net 4 , WPF FrameworkElements are able to bind to
I'm wondering if it's possible to bind a TList object as a cxGrid datasource.
I'm not able to bind events to a list that is generated by jQuery.

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.