Prev | Current Page 681 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

The StackPanel gets the bounds that are required for the rotated
button and lays out the second button accordingly.
Figure 13-17. Rotating buttons
There are a few rare elements that can??™t be transformed because their rendering work isn??™t
native to WPF. Two examples are the WindowsFormsHost, which lets you place a Windows
Forms control in a WPF window (a feat demonstrated in Chapter 25) and the Frame element
when it??™s used to display HTML content (in which case it relies on the COM-based Web-
Browser control from Internet Explorer).
To a certain degree, WPF elements aren??™t aware that they??™re being modified when you set
the LayoutTransform or RenderTransform properties. Notably, transforms don??™t affect the
ActualHeight and ActualWidth properties of the element, which continue to report their
untransformed dimensions. This is part of how WPF ensures that features such as flow layout
and margins continue to work with the same behavior, even when you apply one or more
transforms.
Better Brushes
As you know, brushes fill an area, whether it??™s the background, foreground, or border of an
element, or the fill or stroke of a shape. You??™ve used brushes throughout this book, but so far
you??™ve done most of your work with the straightforward SolidColorBrush. You??™ve also learned
these fundamental facts about brushes:
??? Brushes support change notification because they derive from Freezable.


Pages:
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693