//File:Window.xaml.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace WpfApplication1 {
public class Person : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
protected void Notify(string propName) {
if( this.PropertyChanged != null ) {
PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
}
string name;
public string Name {
get { return this.name; }
set {
this.name = value;
Notify(“Name”);
}
}
int age;
public int Age {
get { return this.age; }
set {
this.age = value;
Notify(“Age”);
}
}
}
class People : ObservableCollection { }
public class NamedAge : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged;
protected void Notify(string propNameForAge) {
if( this.PropertyChanged != null ) {
PropertyChanged(this, new PropertyChangedEventArgs(propNameForAge));
}
}
string nameForAge;
public string NameForAge {
get { return this.nameForAge; }
set {
this.nameForAge = value;
Notify(“NameForAge”);
}
}
int ageId;
public int AgeId {
get { return this.ageId; }
set {
this.ageId = value;
Notify(“AgeId”);
}
}
}
class NamedAges : ObservableCollection { }
public partial class Window1 : System.Windows.Window {
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok