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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:24:26+00:00 2026-05-30T01:24:26+00:00

I am studying WPF databinding using this tutorial . Here is my XAML: Window

  • 0

I am studying WPF databinding using this tutorial.

Here is my XAML:

Window x:Class="DataBinding_01.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        
        Title="MainWindow" Height="350" Width="525">

    <Window.Resources>
        <local:Person x:Key="PersonDataSource" Name="Joe"/>
    </Window.Resources>

    <DockPanel Height="Auto" Name="panel" Width="Auto" LastChildFill="True">
        <TextBox DockPanel.Dock="Top" Height="23" Name="txtName" Width="Auto" />
        <Button Content="Button" Name="button1" Width="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="button1_Click" />
    </DockPanel>
</Window>

Here is my code:

 public partial class MainWindow : Window
    {
        Person myPerson = null;
        public MainWindow()
        {
            InitializeComponent();
            myPerson = this.Resources["PersonDataSource"] as Person;
            myPerson.NameProperty = "hi, again!";
        }    
    }

    public class Person 
    {

        Person()
        {
            NameProperty = "hi";
        }

        Person(String _name)
        {
            NameProperty = _name;
        }

        private String name = "";
        public String NameProperty
        {
            get { return name; }
            set 
            { 
                name = value;
            }
        }  

    }

When I am building the solution I get the error:

Error 1 ”local’ is an undeclared prefix. Line 7, position 10.’ XML is
not
valid. C:\Users\Admin\Desktop\DataBinding_01\DataBinding_01\MainWindow.xaml 7 10 DataBinding_01

Why and how can I fix it ?

  • 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-30T01:24:28+00:00Added an answer on May 30, 2026 at 1:24 am

    You need to specify the local namespace in XAML to point to your Person‘s class namespace:

    If the Person class in the DataBinding_01 namespace:

    <Window x:Class="DataBinding_01.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:DataBinding_01"        
            Title="MainWindow" Height="350" Width="525">
    

    In your sample article:

    <Window
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:BindingSample">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am studying a code base developed using .NET WPF. I am using Visual
As I am studying Yii I keep for looking this class of Yii:app()-> user
Being new to both WPF and MVVM, I'm studying Josh Smith's article on the
In studying actionscript 3's graphics class, I've come across the undocumented drawRoundRectComplex() method. It's
While studying for the SCJP 6 exam, I ran into this question in a
After studying Hadley's book and searching here on SO I have created a heatmap
Im studying some ruby code and I see this varx variable being used with
While studying a software methodologies, I often see disclaimers along the lines of This
I was just studying OCPJP questions and I found this strange code: public static
I studying NSCharacterset class. NSString and NSCharacterset look like similar class. Who can explain

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.