TAILIEUCHUNG - Lập trình .net 4.0 và visual studio 2010 part 49

Hãy chạy qua dòng mã để hiểu những gì họ làm. Các dòng sau đó nói với trình biên dịch lớp kế thừa từ. (Nó tương tự như kế thừa của 'bất động sản trong một aspx. Hoặc ascx file) | CHAPTER 14 SILVERLIGHT INTRODUCTION Hi Yo Silver Let s create a Hello World or Hi yo Silver application 1. Open the file . 2. By default will contain a Grid tag like the following Grid x Name LayoutRoot Background White Grid Silverlight and WPF allow you to nest tags inside one another. Enter the following between the Grid tags TextBlock Hi yo Silver TextBlock You should now have something like the following UserControl x Class xmlns http winfx 2006 xaml presentation xmlns x http winfx 2006 xaml xmlns d http expression blend 2008 xmlns mc http markup-compatibility 2006 mc Ignorable d d DesignHeight 300 d DesignWidth 400 Grid x Name LayoutRoot Background White TextBlock Hi yo Silver TextBlock Grid UserControl 3. Press F5 to run your application. You should see the text Hi yo Silver displayed on a page. Understanding the Basics Let s run through the lines of code to understand what they do. The following line tells the compiler which class to inherit from. It is similar to s inherits property in an .aspx or .ascx file. x Class The lines beginning with xmlns import a number of WPF- and Silverlight-related namespaces such as a using or imports statement . The following line creates a TextBlock on the page and sets the text to Hi yo Silver TextBlock Hi yo Silver TextBlock NOTE Hi yo Silver was a line said by the Lone Ranger as he rode away on his horse. It was on a TV radio series that I am too young to remember but it was the only Silver-related reference I could think of. Note the line xmlns x x is a prefix you can use to refer to this namespace. You then use this prefix in the line x name which is similar in function to s ID property. 333 CHAPTER 14 SILVERLIGHT INTRODUCTION Adding Content Content can be added either declaratively or programmatically. If you .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.