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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:37:24+00:00 2026-06-11T03:37:24+00:00

I asked a question earlier regarding <Button Command={StaticResource hwc} CommandParameter=Hello … in which to

  • 0

I asked a question earlier regarding

<Button Command="{StaticResource hwc}" CommandParameter="Hello" ...

in which to overcome my problem i was asked to switch the place of these two attributes i.e. CommandParameter should come first and Command` later. This way

<Button CommandParameter="Hello" Command="{StaticResource hwc}" ...

No doubt, this thing worked. But left a few questions in my mind.

  1. Do the order of attributes matter?
  2. Does this same principle apply to styles also. My seniors at job say styles should be written/defined in a file before they are used

I have a button designed

<Button Style="{StaticResource FooStyle}" ....

and the style is defined way down below after this button is declared

<Style x:Key="FooStyle" TargetType="{x:Type Path}" ...

Will this style be applied to that button even though it is declared after button is declared?

In code behind we cannot use a variable before its declaration, so does the same apply to XAML code also?

  • 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-11T03:37:26+00:00Added an answer on June 11, 2026 at 3:37 am

    Yes indeed you need to define your Style above its usage if you are referring to it using StaticResource but in case you are referring it as a DynamicResource, the order does not matter. It gets resolved at run time.

    <Button Style={DynamicResource FooStyle}...
    

    Refer to this link for detailed description for the difference StaticResource vs DynamicResource

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

Sidebar

Related Questions

I asked this question earlier but regarding another programming languages. Let's say I have
I asked a question earlier on here regarding the use of First Responder -
This is a follow up to a question I asked earlier today regarding the
I have a supplemental question to a question I asked earlier, which you can
I had asked a question earlier regarding ExecutorService and Apache Velocity initialization. To give
I asked a question earlier about which method for saving would be better, I
I asked a question earlier today regarding using Perl to search in a CSS
Earlier today a question was asked regarding input validation strategies in web apps .
Earlier today I asked this question which arose from A- My poor planning and
I asked a question earlier about which language to use for an AI prototype.

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.