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

  • Home
  • SEARCH
  • 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 743015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:48:51+00:00 2026-05-14T08:48:51+00:00

I have this control template that I am writing: <Style TargetType={x:Type controls:InfoBar}> <Setter Property=Template>

  • 0

I have this control template that I am writing:

<Style TargetType="{x:Type controls:InfoBar}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type controls:InfoBar}">
                <Border Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                    <StackPanel>
                        <Grid>
                            <Grid.Resources>
                                <Style TargetType="{x:Type TextBlock}">
                                    <Setter Property="FontFamily" Value="{TemplateBinding FontFamily}" />
                                    <Setter Property="FontSize" Value="{TemplateBinding FontSize}" />
                                    <Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
                                </Style>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <ItemsControl Grid.Column="0" ItemsSource="{TemplateBinding LeftInfoBarTextBlockCollection}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                            <ItemsControl Grid.Column="1" ItemsSource="{TemplateBinding MiddleInfoBarTextBlockCollection}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                            <ItemsControl Grid.Column="2" ItemsSource="{TemplateBinding RightInfoBarTextBlockCollection}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Grid>
                    </StackPanel>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

This section of xaml is throwing member is not valid because it does not contain a valid type name. exceptions for the template bindings on FontFamily, FontSize and Foreground.

<Grid.Resources>

If I change it to this:

 <Grid.Resources>

It will build, but when I debug it, I get this XmlParseExeption:

Set property 'System.Windows.Setter.Value' threw an exception.

If I change controls:InfoBar to Control, which InfoBar inherits from, I get the same exception.

What am I doing wrong?

  • 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-14T08:48:52+00:00Added an answer on May 14, 2026 at 8:48 am

    The problem is in this:

    <Style TargetType="{x:Type TextBlock}">         
       <Setter Property="FontFamily" Value="{TemplateBinding FontFamily}" />         
       <Setter Property="FontSize" Value="{TemplateBinding FontSize}" />         
       <Setter Property="Foreground" Value="{TemplateBinding Foreground}" />         
    </Style>
    

    You can use TemplateBinding only inside a control template.
    and here you using it inside a style.

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

Sidebar

Related Questions

i have button with this style: <Style TargetType=Button x:Key=btnStyle> <Setter Property=Template> <Setter.Value> <ControlTemplate TargetType=Button>
I have a control template for a button that looks like this: <ControlTemplate x:Key=CopyButton
I have some what complex UI requirement, need help in understanding type of control/style/template
I'm creating a custom control called ImageFader. The style template looks like this: <ControlTemplate
I have a control that handles commenting. In this control, I have set a
I have a view user control that can post form. This control can be
I have a custom control that inherits from .NET's CompositeControl class. This control overrides
I have a control template defined, call it myVal, that is used for validation
I have a custom control template for a ListView that puts an extra line
I have this Editor Template so that I have a datepicker set for date

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.