TAILIEUCHUNG - Illustrated WPF phần 6

Tài sản gắn liền có hai phương pháp tĩnh của getxxx hình thức và SetXXX, trong đó XXX là tên của lĩnh vực bất động sản phụ thuộc, mà không có hậu tố bất động sản. - - Những phương pháp này gọi là phương pháp getValue và setValue của đối tượng mục tiêu. Các đối tượng mục tiêu phải được bắt nguồn từ DependencyObject, để cho các phương pháp getxxx và SetXXX gọi getValue của nó và các phương pháp setValue | CHAPTER 9 ROUTING EVENTS AND COMMANDS Commands have as part of their architecture a way for the programmer to specify under what circumstances a command should be available and when it should not be available. You can see this in action in the buttons in the example program. Figure 9-13 shows that the buttons acting as the sources for the Cut and Paste commands are automatically enabled or disabled appropriately for their clipboard functions. In the first screenshot neither of the buttons is enabled. This is because there is no selected text in the first TextBox for the Cut command to work on and no text on the system clipboard to be pasted by the Paste command. In the second screenshot where there is selected text in the first TextBox the Cut button has automatically become enabled. In the third screenshot the Cut button has been clicked deleting the text from the first TextBox and placing it on the system clipboard. - Since there s no longer any selected text in the first TextBox the Cut button becomes disabled. - Since there s now text on the system clipboard the Paste button automatically becomes enabled. Although you can t see it in the figure the keyboard shortcuts also work as you d expect. - When the Cut button is enabled and the focus is on the first TextBox you can use the Ctrl X keyboard shortcut to cut the text. - When the Paste button is enabled and the focus is on the second TextBox you can use the Ctrl V keyboard gesture to paste the text. Notice that there is nothing explicitly in the code to create any of this behavior and yet it does the right things. The reason these work is that this functionality was built in to the controls to hook up with these predefined commands. The command architecture allows you to build similar functionality into your own custom commands. J Commands I co II B IH I 1 Cut I Paste I k Neither button is Enabled. J Commands I CJ II E qwerty I Cut I Paste I I 1 fe I With selected text the Cut button becomes Enabled. With text

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
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.