using System.Windows;
using WpfApp4.model;
namespace WpfApp4
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public IEnumerable PersonList { get; set; }
public MainWindow()
{
InitializeComponent();
DataContext = this;
Globals.dataProvider = new LocalDataProvider();
PersonList = Globals.dataProvider.getPerson();
}
private void ExitButton_Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
}
interface IDataProvider
{
IEnumerable getPerson();
}
public class LocalDataProvider : IDataProvider
{
private object name;
public IEnumerable getPerson()
{
return new mechanic[] {
new mechanic {
doljnost="Мойщик",
name="Чувакер"},
new mechanic{
doljnost="Отладчик",
name="Мистер Мистерио"},
new mechanic{
doljnost="Директор",
name="Мистер крутой"},
};
}
}
public class doljnost
{
}
}