Intersoft ClientUI 8 > ClientUI Controls > Control Library > Content Controls Overview > ContentPerspective |
ContentPerspective is a lightweight content control that adds a unique perspective effect when the content is applied with projection transform.
ContentPerspective is inherited from ISContentControl, which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information about this content model, see Content Model Overview.
The following example shows multiple content types used as content of ContentPerspective.
XAML |
Copy Code
|
---|---|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal"> <Intersoft:ContentPerspective Height="192" Width="256" RotationY="-45"> <Image Source="/Penguins.jpg"/> </Intersoft:ContentPerspective> <Intersoft:ContentPerspective Height="150" Width="150" RotationY="45"> <Intersoft:UXButton Content="Button" VerticalAlignment="Bottom"/> </Intersoft:ContentPerspective> <Intersoft:ContentPerspective Height="150" Width="150" RotationY="45"> <Intersoft:UXTextBox Text="Text Box Content" VerticalAlignment="Bottom"/> </Intersoft:ContentPerspective> </StackPanel> |
By default, ContentPerspective generates the reflection image based on the specified content. You can use any data types as the content to be reflected by the ContentPerspective. However, if you’re using an Image as its content, it is recommended to use ReflectionSource to improve the performance. By providing ReflectionSource, the control will use the provided image instead of automatically generating the reflection image.
If you are using non-image content type and having performance issue, you may want to set the AutoRefresh property to false. When set to true, this property enables ContentPerspective to re-generate the reflection image whenever the content layout is updated, for instance, due to changes in the content such as text input, resizing, and visual states change.
The following example shows how to use ReflectionSource to improve the performance by skipping the reflection process.
XAML |
Copy Code
|
---|---|
<Intersoft:ContentPerspective Height="192" Width="256" ReflectionSource="/Penguins.jpg" RotationY="-45"> <Image Source="/Penguins.jpg"/> </Intersoft:ContentPerspective> |
The following are two properties that you can customize to control the ContentPerspective appearance.
The main function of ContentPerspective is to add 3D perspective effect when an object is transformed or projected using plane projection. You can either use Silverlight built-in plane projection or using the provided properties to project the content.
The following list describes the provided properties you can set directly from the control:
For cross-platform development, you should use the provided properties above to enable code and API compatiblity across Silverlight and WPF project. For more information, see Unified Development Model. |