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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:31:33+00:00 2026-06-10T18:31:33+00:00

When I create a WPF application in VS 2010 and place a button in

  • 0

When I create a WPF application in VS 2010 and place a button in Grid I can access the control from C# code. I have the button class instance variable with the same name as in XAML “name” field.
But I can’t see the instance of the control when I create a WPF project using VS 2012 RC.
What can be the problem ? Is there any default project settings difference between VS 2010 and 2012 ?

  • 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-10T18:31:34+00:00Added an answer on June 10, 2026 at 6:31 pm

    If you’re talking about codebehind then you should be able to access to the button without declaring it again just by using it’s x:name attribute. Now, if you’re talking about MVVM, then you should set your datacontext before using the button.

    When I’m using 2012 (Release Candidate) I get no intellisense for the codebehind cs files when trying to access elements declared in the xaml (I have to wrote the code without it) and it even suggest there’s no element by that name but project compiles and works. So I’ll suggest you to try to write the code without intellisense and compile it.

    YourButton.IsEnabled = false;
    

    I guess this is by default in VS 2012 to encourage use of MVVM but that’s no more than thoughts.

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

Sidebar

Related Questions

i have a WPF Application with a LoginWindow to access,so i create a Splash
How to create WPF Application Preloader (like one on this Word 2010 Prt Scrn)?
How to create a WPF application that can be deployed as either a XBAP
In a WPF application, I can create an inherited property by using the FrameworkPropertyMetadata:
I have a C# WPF application where I need to create a bunch of
I have a WPF application where I'd like to create a custom pop-up that
Exactly as the subject, How to create oval button in WPF application?
I have created a wpf application into which I have added a user control
I'm using Visual Studio 2010 to create a small WPF application. I've created a
I have a WPF application where I'm trying to create a diagnostics panel that's

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.