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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:01:37+00:00 2026-05-28T06:01:37+00:00

I am a newbie to WPF. I am practising the sample code in WPF

  • 0

I am a newbie to WPF.
I am practising the sample code in WPF unleashed .
When I was trying to implement the Attached events , I modified the class name an Xaml file to a different class name , that is as same as my namespace of the new page and I am debugger
complains with this error:

Error 1 The namespace ” already contains a definition for ‘AboutDialog1’

Can anybody please let me know why am I getting such errors?

my code :

<Page 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      x:Class="AboutDialog1" ListBox.SelectionChanged ="ListBox_selectionchanged"

    Title="attachedevents">
    <StackPanel>
        <Label FontWeight="Bold" FontSize="20" Foreground="White">wp4 unleashed </Label>
        <ListBox> 
            <ListBoxItem>chapter 1</ListBoxItem>
            <ListBoxItem>chapter 2</ListBoxItem>
        </ListBox>
    </StackPanel>

namespace AboutDialog1
{
    public partial class AboutDialog: Page
    {
        public AboutDialog()
        {

        }
        void ListBox_selectionchanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count > 0)
                MessageBox.Show("you have selected " + e.AddedItems[0]);

        }

    }   
  • 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-28T06:01:37+00:00Added an answer on May 28, 2026 at 6:01 am

    x:Class should point to a class, not the namespace containing it, so it should be x:Class="AboutDialog1.AboutDialog"

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

Sidebar

Related Questions

I am WPF newbie. In a WPF sample code I am looking at, there
I'm a XAML/WPF newbie, and I thought I'd write an alarm clock application to
I am a newbie to WPF, and am trying to learn the standard idioms.
I have a newbie WPF question. Imagine my user control has a namespace declaration
I am a newbie to WPF and have a couple of questions about WPF
I'm a newbie in WPF and I would like to ask if it's possible
Please help to the newbie in WPF! I need to build a TreeView with
Newbie to LINQ, and trying to write the following query... select f.Section_ID, f.Page_ID, f.SortOrder,
I'm a newbie in WPF applications. I want to create a application that displays
I'm a newbie to WPF and I'm developing a brand new windows desktop application

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.