Friday, 10 May 2013

Border Effects | WPF Tutorial pdf

As I have already used some Border Effects previously, lets see what are the main effects that you might use in real life.
Border element or any element inherited from Border supports two types of Effects.
1. Effect : Effects are applied to the whole Border. Thus any control inside the Border will also be affected with the effect.
Thus you can see using BlurEffect in the Border actually affects the Text written in the TextBlock inside the Border.
You will get clear idea by looking at the code below :
<Border Background="AliceBlue" Width="100" Height="100" CornerRadius="5"
BorderBrush="Black" BorderThickness="2">
<Border.Effect>
<BlurEffect Radius="3" RenderingBias="Quality" />
</Border.Effect>
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center" Text="This is inside Blured Border"
TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
</Border>
2. DropShadowEffect : It is used to place a shadow outside the Border. I have already discussed with it in previous section of the article , so no need to elaborate this anymore.

No comments: