Lập trình .net 4.0 và visual studio 2010 part 53

Ngoài các tiêu chuẩn điều khiển Silverlight chẳng hạn như TextBox, hình ảnh, và thêm điều khiển ComboBox như là DataGrid, trượt, và Lịch có sẵn. Cách dễ nhất để sử dụng điều khiển DataGrid như là để kéo chúng từ thanh công cụ và đã VS phân loại các tài liệu tham khảo cho bạn. | CHAPTER 14 SILVERLIGHT INTRODUCTION 9. Add an event handler for the click of the Media button in MediaTest_Loaded new RoutedEventHandler cmdMediaTest_Click 10. Add the event handler code void cmdMediaTest_Click object sender RoutedEventArgs e new 11. Press F5 to run your application and click the Media button. You should see the WMV file playing. You can click the buttons to pause play and stop the media player. Silverlight contains rich media functionality allowing you to jump to specific points on the video alter playback speed and so on. TIP You can even use media files as a brush to fill in XAML elements. Additional Controls In addition to the standard Silverlight controls such as TextBox Image and ComboBox additional controls such as a DataGrid Slider and Calendar are available. The easiest way to use controls such as DataGrid is to drag them from the toolbar and have VS sort out the references for you. Data Binding There are few applications that do not have to work with data. Silverlight offers a rich binding model that makes it very easy to work with data. Let s create a simple example to bind data to a text box 1. Add a new folder called DataBinding to the example project. 2. Right-click and AddXNew ItemXSilverlight UserControl. Call it DataBindingTest. 3. In the XAML you need to add a namespace reference to the assemblies you re going to use. Add the following line in the UserControl tag of xmlns Data clr- namespace assembly 4. Between the layout root tag add the following StackPanel Orientation Vertical TextBlock Bound programmatically TextBlock TextBox x Name txtBoundProgrammatically Width 300 Height 20 TextBox TextBlock Bound declaratively TextBlock TextBox x Name txtDeclaration Width 300 Text Binding Title Mode OneWay Height 20 TextBox StackPanel 355 CHAPTER 14 SILVERLIGHT INTRODUCTION 5. Open DataBinding .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.