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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:21:18+00:00 2026-05-22T02:21:18+00:00

I am new to Windows Phone 7. I clicked one button and got: private

  • 0

I am new to Windows Phone 7.
I clicked one button and got:

private void button1_click(object sender, RoutedEventArgs e)
{

}

Is it possible get the tag property and object type of sender?

  • 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-22T02:21:18+00:00Added an answer on May 22, 2026 at 2:21 am

    You can get the Type by using the GetType() method:

    sender.GetType();
    

    If you want to cast it as a button, you can do this.

    var myButton = sender as Button;
    if(myButton != null)
        var buttonTag = myButton.Tag;
    

    Using as instead of (Button)sender means that instead of an exception being thrown if it can’t be cast as a Button, it will simply return null. We can then check if it’s null and, if it’s not null, we can access its Tag property.

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

Sidebar

Related Questions

I am new to the windows phone development, and I am struggling to get
I'm new in programming windows phone 7 but get really tired cuz i spend
I submitted an app to the new windows phone beta marketplace with one tester
I'm new windows phone, I want to create a textbox one by one inside
I am new to Windows phone. I'm storing four values in Dictionary<string, object> .
I am new to Windows Phone (using PhoneGap). Where does the created file get
Where can I find the SDK for new Windows Phone 7?
All, I am very new to Windows Phone and really don't know where to
All, I am new to Windows 7 Phone. My situation is that I have
I am very new at all this c# Windows Phone programming, so this is

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.