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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:35:06+00:00 2026-05-27T04:35:06+00:00

I have a TextBlock tblControl and I want to set a binding similar to

  • 0

I have a TextBlock tblControl and I want to set a binding
similar to xaml’s

Foreground="{Binding ForegroundColor}"

but in code. So I use:

var b = new Binding { Path = new PropertyPath("ForegroundColor") };
tblControl.SetBinding(TextBlock.ForegroundProperty, b);

Everything works.

Now I want to remove Binding to allow a TextBlock to show default Foreground color or I need to set default value of Foreground. tblControl.SetBinding(TextBlock.ForegroundProperty, null); is NOT WORKING. How to do it?

  • 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-27T04:35:07+00:00Added an answer on May 27, 2026 at 4:35 am

    The following will clear a binding (or any other local value):

    tblControl.ClearValue(TextBlock.ForegroundProperty);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following XAML: <TextBlock HorizontalAlignment=Center VerticalAlignment=Center FontSize=10 FontFamily=Arial Foreground=#414141> <Run Text={Binding LoadsCount} />
Windows Phone application (Silverlight 3) I have a textblock <TextBlock Text={Binding Key} FontSize=40 Foreground={Binding
I have a xaml TextBlock bound as follows: <TextBlock Text={Binding LastName}/> How do I
I have the following TabControl: <TabControl x:Name=Networks> <TabControl.ItemTemplate> <DataTemplate> <StackPanel Orientation=Horizontal> <TextBlock Text={Binding DisplayName}
I have TextBlock in my main form. I set the Text property to different
Say I have XAML like <TabControl Grid.Row=1 Grid.Column=2 ItemsSource={Binding Tabs} IsSynchronizedWithCurrentItem=True> <TabControl.ItemTemplate> <DataTemplate> <TextBlock
I have a TextBlock that I want to display a user name, and email
I have a data bound tab control: <TabControl ItemsSource={Binding Products} Name=ProductsTabControl> <TabControl.ItemTemplate> <DataTemplate> <TextBlock
Hi i have a xaml code like this <Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=test.Window1 x:Name=Window Title=Window1
I have a TextBlock which is rotated at 90 degrees in the Silverlight XAML:

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.