TAILIEUCHUNG - [FSC]Apress Pro Entity Framework 4.0_11

CHAPTER 13 ■ DATABINDING WITH THE ENTITY FRAMEWORK WPF Data Binding This section discusses binding with Windows Presentation Foundation (WPF). In this example, you focus on the sales side of things, pulling in SalesOrderHeader and SalesOrderDetail information to populate a simple WPF form. If you’ve never developed an application with WPF before, don’t fear. This example doesn’t go deep into the intricacies of WPF (there are many great WPF books out there), but you get an idea of how to build a simple EF data binding application for WPF. . | CHAPTER 13 DATABINDING WITH THE ENTITY FRAMEWORK WPF Data Binding This section discusses binding with Windows Presentation Foundation WPF . In this example you focus on the sales side of things pulling in SalesOrderHeader and SalesOrderDetail information to populate a simple WPF form. If you ve never developed an application with WPF before don t fear. This example doesn t go deep into the intricacies of WPF there are many great WPF books out there but you get an idea of how to build a simple EF data binding application for WPF. Creating a Project Binding in WPF is quite different from a Windows form because WPF has no built-in binding controls. The first thing you need to do is create the project in the existing solution that you ve been using choose File Add New Project. This opens the Add New Project dialog show earlier in Figure 13-1. This time however you want to select the WPF Application template. Give it the name WPFBinding and click OK. Just like your WinFormsBinding project add a reference to the EF40Data project to this WPFBinding project. Before you start adding code drag a WPF list box onto the window. Again you aren t going for a well-designed layout you simply need a list box. In the code I ve renamed Window1 to MainWindow. You may want to do the same to avoid any confusion. Adding Some Code Let s add some code. Modify the code behind the MainWindow to look like the following. Notice the addition of some using statements besides the default using statements some variable declarations at the Window level and some code in the Loaded event for the window using EF40Data using System using using using using using using using using using using using using using using .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.