private void BuildSearchContactWindow() { contactPicker = new searchCustomer(searchCustomerTypeEnum.Contact); contactPicker_VM = contactPicker.DataContext as searchCustomer_ModelView; contactPickerWindow = new Window() { Title = "Kapcsolattartó választó", Content = contactPicker, SizeToContent = SizeToContent.WidthAndHeight }; contactPicker_VM.CustomerSelected += (s, a) => { DataProxy.Instance.AddContact(viewModel.selectedCustomer, (PersonRepresentation)s); ((FirmRepresentation)viewModel.selectedCustomer).contacts.Add((CustomerBaseRepresentation)s); contactPickerWindow.Hide(); }; }
private void BuildSearchCustomerWindow() { if (customerPicker == null) { customerPicker = new searchCustomer(searchCustomerTypeEnum.Customer); customerPicker_VM = customerPicker.DataContext as searchCustomer_ModelView; } customerPickerWindow = new Window() { Title = "Ügyfél választó", Content = customerPicker, SizeToContent = SizeToContent.WidthAndHeight }; customerPicker_VM.CustomerSelected += (s, a) => { viewModel.selectedCustomer = (CustomerBaseRepresentation)s; customerPickerWindow.Hide(); }; }