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

Một vấn đề chính trong phiên bản trước của Silverlight được rằng không có khả năng chuyển các tập tin để người sử dụng. Silverlight có một tập tin mới tiết kiệm hộp thoại cho phép người dùng để lưu nội dung vào máy địa phương của họ hơn là để lưu trữ bị cô lập. Ví dụ này tạo một tập tin văn bản và sau đó cung cấp cho người sử dụng tùy chọn để lưu nó: | CHAPTER 15 WPF AND SILVERLIGHT 9. You now need to add code to receive the messages and update the text box with the messages you have received. To receive messages handle the MessageReceived event on an instance of LocalMessageReceiver. Open in the receiver project and import the following namespace using 10. Amend to the following public partial class MainPage UserControl LocalMessageReceiver ChannellReceiver new LocalMessageReceiver Channel1 public MainPage new EventHandler MessageReceivedEventArgs Channel1Receiver_MessageReceived InitializeComponent void Channel1Receiver_MessageReceived object sender MessageReceivedEventArgs e NOTE The LocalMessageReceiver constructor sets the parameter to Channell the same channel that messages are being sent on . 11. Press F5 to run the project. 12. Click the Send Message button. A message should then be sent using the local connection API and the results displayed in the text box in the receive project. Styles Styles in Silverlight can now be modified at runtime and support inheritance. Applying Styles Dynamically The following code shows how to apply a style to a button at runtime Style MyHorridFuciaStyle 394 CHAPTER 15 WPF AND SILVERLIGHT Style Inheritance Silverlight allows you to create styles that inherit from another style sort of like CSS by specifying a parent style in the BasedOn property. The following code creates a style inheriting from MyHorridFuciaStyle Style x Key HybridStyle TargetType Button BasedOn StaticResource MyHorridFuciaStyle Style Merge Dictionary Support It is now possible to refer to external resource dictionary files within your application ResourceDictionary ResourceDictionary Source .

Đã 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.