XAML Using Border

Unlike CSS, XAML elements don’t have border property with them. As a subtitute, we can use Border object tag before our XAML object It works more or less same with CSS’s border

<Border 
   BorderThickness="4"
   BorderBrush="Red"
   Background="LightBlue"
   HorizontalAlignment="Center" 
   VerticalAlignment="Center"
   Width="140"
   Height="80">
    <Canvas>
        <TextBlock Canvas.Top="10" Canvas.Left="20">
 			Border sample
        </TextBlock>
    </Canvas>
</Border>

Reference : XAML-border

Published: June 12 2012

blog comments powered by Disqus