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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:38:26+00:00 2026-05-18T09:38:26+00:00

TL;DR Xaml feels opaque to me, why did removing TargetName from an animation fail

  • 0

TL;DR Xaml feels opaque to me, why did removing TargetName from an animation fail in one case and work in another for the exact same (copy and pasted) Trigger declaration?

In This question my problem was solved by moving the trigger into a style and applying the style to the text boxes. From the example you can see the storyboard has a TargetName property set to the name of one of the text boxes.

While trying to make this work I had also put the trigger in the Grid.Triggers section and removed the TargetName property. This caused an exception to be thrown.

The solution involved putting it in a style and then removing the TargetName property setter. The style wasn’t named, but applied to text boxes. In this case, with TargetName not set, it worked.

So here is the question. It took me a bit of fiddling to get it to work, renaming TargetName seemed sensible, as I wanted it to apply to several text boxes, but I had tried that when I put it in the Grid.Triggers section. Why didn’t that work, and why did it work in a style? More importantly, how do I use that knowledge to solve similar problems later on? That’s the tricky bit I think, Xaml seems quite opaque to me at the moment.

  • 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-18T09:38:26+00:00Added an answer on May 18, 2026 at 9:38 am

    Storyboard.TargetName is not about applying a behavior; it is a portion of the execution of the behavior. Styles are typically about applying a predefined behavior across varying instances which may include a Storyboard and potentially a Storyboard.TargetName.

    In addition styles can often be inline or exterior as a referenced resource. It can depend on how the style is being used, ie…is it a one off for that specific control or is this something we want propagated throughout the application?

    Understanding the concepts up front will prevent hours of troubleshooting later on. There are many great articles out there around WPF and its concepts, as well as many great books.

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

Sidebar

Related Questions

In XAML we can put one long string in the positions property, How do
I have the following XML: <Items> <Item> <Name>Item One</Name> <MyValue>42</MyValue> </Item> </Items> and XAML:
I'm trying to make a simple Windows Store game in C# and XAML, one
xaml side: <DataGrid Name=MyGrid ItemsSource={Binding} /> I tried also with: <DataGrid Name=MyGrid ItemsSource={Binding MyObj}
In xaml, I have a listbox with a grid in it with 1 row
The xaml for the first style works as I want, producing a button with
In XAML, you can define a size property (such a length or width) in
This XAML makes text fade in when it appears. I would like to put
In XAML, if you insert <TextBlock Text=Hello World /> You will see the words
My XAML code is like this: <Window xmlns ='http://schemas.microsoft.com/netfx/2007/xaml/presentation' xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml' Title ='Print Preview

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.