tailieunhanh - Illustrated WPF phần 8

Tham số đầu tiên là tên của tài sản phụ thuộc tài nguyên được giao. Bạn phải sử dụng tên của tài sản phụ thuộc, và không phải là tên của tài sản bao bọc CLR. Vì vậy, trong trường hợp này, bạn phải sử dụng BackgroundProperty và không nền. Tham số thứ hai là phím nguồn. | CHAPTER 14 PAGE NAVIGATION PROGRAMS Figure 14-19. Code implementing and navigating to a PageFunction 332 CHAPTER 14 PAGE NAVIGATION PROGRAMS XAML Browser Applications At the beginning of the chapter I introduced XAML browser applications. As you probably remember these applications also called XBAPs don t run as their own stand-alone executable programs. Instead they must be run hosted inside a web browser such as Internet Explorer or Firefox. The following are some of the important characteristics of XBAPs Like the stand-alone navigation programs they offer a simple navigation paradigm that s easy and intuitive. This can be ideal for people who aren t comfortable running computer programs but know how to surf the Web. XBAPs run in Internet Explorer and Firefox. However they are Windows programs not web applications so they must be run on a Windows computer running .NET or above. From a developer s standpoint the navigation API for XBAPs is the same API we ve been using throughout this chapter. XBAPs are easier to deploy than standard Windows programs using a technology called ClickOnce deployment. XBAPs run in partial trust mode and hence have their functionality limited for security reasons. This means that not all the API calls that are valid in a standalone page navigation program can run in an XBAP Creating an XBAP Application Visual Studio provides a standard template for XBAPs. It s called the WPF Browser Application template. To create an XBAP project do the following 1. In Visual Studio click on File New Project which pops up the New Project window. 2. In the Project Types panel of the New Project window select Windows. 3. In the Templates panel select WPF Browser Application and fill in the Name text box. Use the name FirstXBAP if you want to create and run the next example. 4. Click the OK button and Visual Studio prepares the project for you. 333 CHAPTER 14 PAGE NAVIGATION PROGRAMS From here you can use the API you have been using throughout this .

TỪ KHÓA LIÊN QUAN