123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.Windows;
- using WpfApp4.model;
- namespace WpfApp4
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public IEnumerable<mechanic> 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<mechanic> getPerson();
- }
- public class LocalDataProvider : IDataProvider
- {
- private object name;
- public IEnumerable<mechanic> getPerson()
- {
- return new mechanic[] {
- new mechanic {
- doljnost="Мойщик",
- name="Чувакер"},
- new mechanic{
- doljnost="Отладчик",
- name="Мистер Мистерио"},
- new mechanic{
- doljnost="Директор",
- name="Мистер крутой"},
- };
- }
- }
- public class doljnost
- {
- }
- }
|