Код: Выделить всё
< /code>
Просмотр модели: < /p>
using System.Collections.ObjectModel;
using System.Security.Cryptography.X509Certificates;
using Prism.Commands;
using Prism.Mvvm;
namespace TestWpf.ViewModels
{
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string Address { get; set; }
public string Sex { get; set; }
}
public class MainWindowViewModel : BindableBase
{
public ObservableCollection People { get; set; }
private string _title = "Prism Application";
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
}
public MainWindowViewModel()
{
People = new ObservableCollection
{
new Person
{
Name = "John Doe", Age = 30, Phone = "123-456-7890", Email = "[email protected]",
Address = "123 Main", Sex = "Male"
},
new Person
{
Name = "Jane Smith", Age = 25, Phone = "987-654-3210", Email = "xxx", Address = "xxxxxx",
Sex = "Female"
},
};
ButtonClickedCommand = new DelegateCommand(BtnClicked);
}
public DelegateCommand ButtonClickedCommand { get; private set; }
public void BtnClicked()
{
int a = 1; int b = 2;
int c = 3;
}
}
}
Введите описание изображения здесь
Подробнее здесь: https://stackoverflow.com/questions/796 ... ng-c-wpf-p