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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:20:38+00:00 2026-05-17T23:20:38+00:00

<Border Name=ItemBorder Margin=5 5 0 5 BorderBrush=Black BorderThickness=1 Height=75 Width=75> <Border.Background> <SolidColorBrush x:Name=ItemBorderBrush Color=LightBlue/>

  • 0
<Border Name="ItemBorder" Margin="5 5 0 5" BorderBrush="Black" BorderThickness="1" Height="75" Width="75">
  <Border.Background>
    <SolidColorBrush x:Name="ItemBorderBrush" Color="LightBlue"/>
  </Border.Background>
  <ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
  <EventTrigger RoutedEvent="someEvent">
    <BeginStoryboard>
      <Storyboard TargetName="ItemBorderBrush" TargetProperty="Color" Duration="0:0:1" >
      <!--Storyboard TargetName="ItemBorder" TargetProperty="Background.Color" Duration="0:0:1"> -->
         <ColorAnimation To="White"/>
      </Storyboard>
    </BeginStoryboard>
  </EventTrigger>
</ControlTemplate.Triggers>

I’ll try to explain my question clearly. The Storyboard Target name, when it is “ItemBorder” (the commented out line) works intermittently. Sometimes I get an error that the name “ItemBorder” cannot be found in the scope.

I decided to follow a style from an MSDN example of this, and change the color property directly on the brush, instead of having the target of the storyboard be the border, and changing the color of the border’s brush by property (the commented out line). This seems to work.

However, Name="ItemBorderBrush" does not compile because Name is not a property of SolidColorBrush so I use x:Name="ItemBorderBrush" Both Name and x:Name are accepted for the Border. Why is this?

What does the x: mean (how is x:Name different from Name), and why would having the Name property of border only work with the storyboard sometimes?

  • 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-17T23:20:38+00:00Added an answer on May 17, 2026 at 11:20 pm

    The x: prefix is simply setting an attribute from a seperate namespace:

    Within the namespace declarations in
    the root tag of many XAML files, you
    will see that there are typically two
    XML namespace declarations. The first
    declaration maps the overall WPF
    client / framework XAML namespace as
    the default:

    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”

    The second declaration maps a separate
    XAML namespace, mapping it (typically)
    to the x: prefix.

    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

    The relationship between these
    declarations is that the x: prefix
    mapping supports the intrinsics that
    are part of the XAML language
    definition, and WPF is one
    implementation that uses XAML as a
    language and defines a vocabulary of
    its objects for XAML. Because the WPF
    vocabulary’s usages will be far more
    common than the XAML intrinsics
    usages, the WPF vocabulary is mapped
    as the default

    So, the reason that Name and x:Name both work on Border is because Border has a property called Name. It also supports the XAML Intrinsic usage of x:Name (which is what WPF uses to create the named instance of the class).

    However, SolidColorBrush doesn’t have the property called Name so it only supports the XAML Intrinsic usage of x:Name.

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

Sidebar

Related Questions

<Border CornerRadius=2,2,2,2 BorderThickness=1 BorderBrush=LightSkyBlue Margin=5,2,2,2 x:Name=PersonBorder Visibility=Collapsed> <StackPanel Orientation=Vertical> <ListBox Name=personListBoxTest BorderThickness=0 ScrollViewer.HorizontalScrollBarVisibility=Hidden ScrollViewer.VerticalScrollBarVisibility=Auto
CSS: .dynamicDiv { width:200px; border:solid 1px #c0c0c0; background-color:#e1e1e1; font-size:11px; font-family:verdana; color:#000; padding:5px; } Javascript:
Using CSharp, how can I set the width, height, border color etc to the
I have this box: <div class=message_box_red id=commentForm_error_name style=width: 409px; height: 0px; border: 0; margin:
border:3px solid black; In the above example, you can set color by saying the
How can we set border and background color in the WPF grid control ,
I've got the following: .panelHeader { border: 1px solid #474747; color: white; background-color: #5D7B9D;
<td id=display5 class=displayableCell style=border: 0px none; width: 120px;> <span id=name5>Photo Name</span> <br> <img id=img5
Here is what DataGrid does to my table: <table id=ContentPlaceHolder1_articleList cellspacing=0 style=border-width:0px;border-collapse:collapse; headertext=File Name
I wish to just select and place border around .L1Cell element where attribute name

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.