tailieunhanh - Essential Silverlight 3- P5

Essential Silverlight 3- P5: Khái quát Silverlight 3 không chỉ là lấp đầy với các chi tiết kỹ thuật, ví dụ rõ ràng, và thực hiện lời khuyên rằng sẽ làm cho bất kỳ ứng dụng Silverlight tốt hơn, nhưng Ashraf cũng bao gồm những hiểu biết rằng chỉ có thể đến từ một trong những nhà phát triển dẫn của thời gian chạy Silverlight. Từ đồ họa, văn bản, để phương tiện truyền thông cuốn sách này- có tất cả các thông tin cần thiết về thời gian chạy lõi 3 Silverlight | 168 Chapter 7 Layout Width Height Canvas Furthermore you learned that snapping Rectangle elements to integer positions removes these seams as shown in Figure . Figure Pixel snapped rasterization Canvas xmlns http client 2007 Rectangle Fill Black Width 100 Height 100 Rectangle Fill Black 100 Width 100 Height 100 Canvas The problem introduced with an automatic layout system is that you no longer determine the sizes and positions of elements in your code. For example if a StackPanel element contains elements that have non-integer widths and heights which is common with text some backgrounds shapes and images may be positioned at non-integer positions and might generate either seams or blurry images. To solve the seaming problem and produce sharper images the Silverlight layout system automatically rounds sizes of elements up to the nearest integer value so that widths and positions typically remain Please purchase PDF Split-Merge on to remove this watermark. Layout Elements 169 integers. You can turn off automatic layout rounding by setting the UseLayoutRounding property on a UIElement to False . Building a Custom Layout In some cases you may want different layout behavior than the built-in layout elements provided by Silverlight. For example suppose you want an element that can stack elements horizontally until they no longer fit and then wrap the next elements into further horizontal stacks in new rows as shown in Figure . Figure WrapPanel example Grid RowDefinition Height Auto app WrapPanel Button Content Button 1 Button Content Button 2 Button Content Button 3 Button Content Button 4 Button Content Button 5 Button Content Button 6 Button Content Button 7 app WrapPanel Grid This type of layout is a WrapPanel element and is not in the Silverlight 3 installation. For these custom layout behaviors you can write a custom layout element. The layout .

TỪ KHÓA LIÊN QUAN