using System.Diagnostics; 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.Navigation; using System.Windows.Shapes; using wpf_template.models; namespace wpf_template { public partial class MainWindow : Window { public IEnumerable peopleList { get; set; } public MainWindow() { InitializeComponent(); DataContext = this; Globals.dataProvider = new LocalDataProvider(); peopleList = Globals.dataProvider.getpeople(); } private void ExitButton_Click(object sender, RoutedEventArgs e) { Application.Current.Shutdown(); } } interface IDataProvider { IEnumerable getpeople(); } public class LocalDataProvider : IDataProvider { public IEnumerable getpeople() { return new people[]{ new people { price=500, name="Марина", age=19 }, new people { price=9600, name="Вика", age=21 }, new people { price=50, name="Кристина", age=17 }, }; } } } /* public class LocalDataProvider : IDataProvider { public IEnumerable getplaces() { return new places[] { new places { place = "Йолка", price = 500, }, new places { place = "КБ", price = 600, }, new places { place = "Шарага", price = 505 } }; } } } */