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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:41:53+00:00 2026-05-17T21:41:53+00:00

I have a TextBlock within a DockPanel within a Border . The TextBlock is

  • 0

I have a TextBlock within a DockPanel within a Border. The TextBlock is data-bound and can be changed with an on-screen keyboard. Therefore, I have hooked it up to validation and it works wonderfully. My dilemma is that I can only seem to change the TextBlock‘s style when there is a validation error. I want to trigger the Border‘s style. How can I do this?

Also is there a way to bind the ErrorContents elsewhere on the view?

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

    Just bind to your TextBox from some other control. Below I bound a Label’s Content property to a TextBox’s (Validation.Errors)[0].ErrorContent property.

    <DockPanel>
    
        <!-- TextBox bound to a data object-->
        <TextBox Name="textBox1" DockPanel.Dock="Top" Text="{Binding Path=Age, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"></TextBox>
    
        <!-- A label that displays the errors from textBox1 -->
        <Label Content="{Binding ElementName=textBox1, Path=(Validation.Errors)[0].ErrorContent}"></Label>
    
    </DockPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a textblock within a GridView that is bound to a property that
I have a UserControl with a Border element within it that I want to
I have a TextBlock bound to a property. However, I'd like to bold certain
I have a textblock that is bound to an object. This object I have
I have a TextBlock bound to a string. I want the string to be
I have a datagrid, which is bound to a RIA data object. this datagrid
I have a TextBlock that I need to autosize to the width of a
I have a databound TextBlock control (which is being used inside a DataTemplate to
I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
Here's the scenario I have a Grid with some TextBlock controls, each in a

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.