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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:52:30+00:00 2026-06-14T21:52:30+00:00

What is the difference for TargetType={x:Type Button} and TargetType=Button

  • 0

What is the difference for

TargetType="{x:Type Button}"

and

TargetType="Button"
  • 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-14T21:52:31+00:00Added an answer on June 14, 2026 at 9:52 pm

    The XAML designer applies inbuilt type converters that convert the string value “Button” to System.Type which is Button , which makes it seem like there is no practical difference.

    However one should practise to use the explicit Type specification using x:Type.

    Explicit Type specification is required is when we inherit Styles using BasedOn, there implicit string Type wont work.

    e.g.

    This would work

     BasedOn="{StaticResource {x:Type Button}}"
    

    But not this…

     BasedOn="{StaticResource Button}"
    

    as here it would try to search a resource with Key “Button”. But in the x:Type specification, as we already specified explicit Button Type the search of the static resource would be happen for the Style which is targetted for a Button.

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

Sidebar

Related Questions

What is the difference between these 2 bindings: <ControlTemplate TargetType={x:Type Button}> <Border BorderBrush={TemplateBinding Property=Background}>
What is the difference between the following TargetType specifications? 1. <Style TargetType={x:Type Button} ...
What is the difference between: <Style TargetType={x:Type Border}> and: <Style TargetType=Border> When and why
I created style for a toggle button, defined below: <Style TargetType={x:Type ToggleButton}> <Setter Property=Template>
I am creating checked list box with the following template: <Style x:Key=CheckBoxListStyle TargetType={x:Type ListBox}>
Here is my XAML: <Style x:Key=ExpanderStyle TargetType={x:Type ToggleButton}> <Setter Property=IsEnabled Value=True /> <Setter Property=Template>
Difference between start-pointers and interior-pointers and in what situation we should prefer one over
What difference does it make when I use a const parameter in a procedure?
The difference between Chr and Char when used in converting types is that one
Any difference, performance-wise?

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.