## Class1 ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WpfApp1.model { public class Place { public string name { get; set; } public int price { get; set; } public string category { get; set; } public string photo { get; set; } } class Client { public string name { get; set; } public int age { get; set; } } } ``` ## Class2 ``` using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WpfApp1.model { class Globals { public static IDataProvider dataProvider; } } ``` ## Mainwindow.xaml.cs ``` 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 WpfApp1.model; namespace WpfApp1 { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public IEnumerable PlaceList { get; set; } public MainWindow() { InitializeComponent(); DataContext = this; Globals.dataProvider = new LocalDataProvider(); PlaceList = Globals.dataProvider.getPlace(); } private void ExitButton_Click(object sender, RoutedEventArgs e) { Application.Current.Shutdown(); } } interface IDataProvider { IEnumerable getPlace(); } public class LocalDataProvider : IDataProvider { public IEnumerable getPlace() { return new Place[]{ new Place{ price=2300, category="По России", name="Москва"}, new Place{ price=5000, category="По России", name="Сочи"}, new Place{ price=15000, category="За границей", name="Токио"}, }; } } } ``` ## Mainwindow.xaml ```