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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:16:16+00:00 2026-06-17T21:16:16+00:00

I’ve used WPF and IDataErrorInfo in the past apps to display errors to the

  • 0

I’ve used WPF and IDataErrorInfo in the past apps to display errors to the user via a controltemplate by putting an image in the adorner and adding a tooltip to the image like this;

<Style x:Key="textStyle" TargetType="TextBox">
  <Setter Property="Validation.ErrorTemplate">
    <Setter.Value>
      <ControlTemplate>
        <DockPanel LastChildFill="True">
          <Border BorderBrush="Orange"
                  BorderThickness="2"
                  CornerRadius="4"
                  SnapsToDevicePixels="True">
            <Border.Effect>
              <DropShadowEffect BlurRadius="10"
                                ShadowDepth="0"
                                Color="Orange" />
            </Border.Effect>
            <DockPanel>
              <Image Width="16"
                     Height="16"
                     Margin="-20,0,0,0"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     RenderOptions.BitmapScalingMode="HighQuality"
                     Source="{StaticResource imgError}"
                     ToolTip="{Binding ElementName=adornedElement,
                                       Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent}"
                     ToolTipService.ShowDuration="30000" />
              <AdornedElementPlaceholder Name="adornedElement" />
            </DockPanel>
          </Border>
        </DockPanel>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

With the appropriate implementation of IDataErrorInfo in the ViewModel and setting Textbox in the view accordingly the image and tooltip are shown;

<TextBox Name="txt"
         Grid.Column="0"
         Height="40"
         Background="Aqua"
         Style="{StaticResource textStyle}"
         Text="{Binding Path=Text,
                        UpdateSourceTrigger=PropertyChanged,
                        ValidatesOnDataErrors=True}" />
<TextBlock Grid.Column="1"
           Height="40"
           Background="AliceBlue"
           Text="{Binding ElementName=txt,
                          Path=(Validation.Errors).CurrentItem.ErrorContent}" />

The above code displays correctly in my previous apps and shows the error in the image tooltip as confirmed by the Textblock.

However, in my current app which is built using Prism I can’t get the Image to display. The TextBlock updates correctly and I can set the error to the TextBox tooltip via a style trigger without any issue. The problem is I can’t seem to get the image (or anything else) to display in the Adorner. The Image is not shown and border is not changed.

The difference between previous apps and this is that the view is in a Region in a ContentControl and I’ve used dependency injection to inject the viewmodel into the view constructor and set the DataContext.

I can’t figure out why this doesn’t work when it did previously. I think I may need to include an AdornerDecorator somewhere but I’m perplexed as to where having tried it in a few places without success. Any ideas how I can ensure the Adorner is shown?

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

    Used an AdornerDecorator to wrap the element containing the texbox and all works fine.

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.