Я новичок в WPF
. Я разработал этот тест MVVM
Приложение, использующее WPF
. Но привязка не работает. Но насколько я знаю, ошибок не обнаружено. может ли кто-нибудь помочь в этом. ниже изображений и кодирования отображается тестовое приложение.WPF привязка Не работает
Student.cs
using System;<br/>
using System.Collections.Generic;<br/>
using System.Linq;<br/>
using System.Text;
using System.ComponentModel;
namespace WpfNotifier
{
public class Student : INotifyPropertyChanged
{
private string _name;
public string Name
{
get { return this._name; }
set
{
this._name = value;
this.OnPropertyChanged("Name");
}
}
private string _company;
public string Company
{
get { return this._company; }
set
{
this._company = value;
this.OnPropertyChanged("Company");
}
}
private string _designation;
public string Designation
{
get { return this._designation; }
set
{
this._designation = value;
this.OnPropertyChanged("Designation");
}
}
private Single _monthlypay;
public Single MonthlyPay
{
get { return this._monthlypay; }
set
{
this._monthlypay = value;
this.OnPropertyChanged("MonthlyPay");
this.OnPropertyChanged("AnnualPay");
}
}
public Single AnnualPay
{
get { return 12 * this.MonthlyPay; }
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
довольно неплохие изображения, которые вы могли бы прикрепить к xaml, самому cs. –
Спасибо .. Dj ill do next time –
Ошибки в ваших привязках появятся в окне «Вывод» при отладке. Если у вас их есть, обмен ими поможет! –