public PageList(List <InsuranceContract> cons) { InitializeComponent(); List <Contract> contracts = new List <Contract>(); foreach (InsuranceContract con in cons) { contracts.Add(new Contract() { ID = con.GetID(), customer = con.GetBuyerName(), benificiary = con.GetBeneficiaryName(), value = con.GetAmount(), term = con.GetContractTerm(), date = con.GetSigningDate(), type = con.Gettype() }); } ContractData.ItemsSource = contracts; ContractData.MouseDoubleClick += (s, e) => { Contract contract = (Contract)ContractData.SelectedItem; var createForm = new PageCreate(contract); NavigationService.GetNavigationService(this).Navigate(createForm); }; }
public MainWindow() { InitializeComponent(); btnList.Click += (s, e) => { var listView = new PageList(); mainContent.Navigate(listView); }; btnCreate.Click += (s, e) => { var createForm = new PageCreate(); mainContent.Navigate(createForm); }; btnSearch.Click += (s, e) => { var searchPage = new SearchPage(); mainContent.Navigate(searchPage); }; }