Posts

Showing posts with the label Silverlight

Working with Rows and Columns in XAML in Silverlight

Image
Introduction
In silverlight, it is very import to have knowledge of rows and columns because they are very primary building block of silverlight based applications that we require always. Hrozontal (Parallel to or in the plane of the horizon or a base line) and Vertical (right angles to the plane) can be called as rows and columns.
Steps to Create Rows and Columns
Follow the steps to create rows and columns:
(i)       Create a brand new project in Expression Blend or if you have any other project then clean its markup first (to understand it well). Here is my very first markup screenshot:

(ii)      Before any further action be sure that yor layout is in Grid mode (not in Canvas mode).

(iii)      Now move your mouse pointer around, you should see an orange horizontal/vertical lines appear on the Grid. Clicking creates a new row/columns in the Grid. On the same slider here, we can drag the line to resize it.

In above screen, I have created three rows and three columns.
(iv)     Now let's lo…

Working with Linear/Radial Gradients and Gradient Vector Transform in XAML Silverlight

Image
Introduction
In Silverlight, gradients specify a range of position dependent colors used to fill a region. The colors produced by a gradient are very continuous with position and produces smooth color transitions.
Silverlight uses two types of gradients:

(i)       Linear Gradient
A linear gradient is specified by two points and a color at each point. The color along the line through those points is calculated using linear interpolation algorithm and then extended perpendicular to that line. Look at the screenshot of a linear gradient.

(ii)      Radial Gradient
A radial gradient is specified as a circle that has one color and a focus that has another color. Colors are calculated by linear interpolation algorithm based on distance from the focus. Look at the screenshot of radial gradient.

Steps to create Linear/Radial Gradients
I'm going to apply the gradient effect in rectangle's fill (you may choose stroke or opacity). For this follow the steps:
1.    First choose where to apply the gr…

Working with Canvas in XAML Silverlight

Image
Introduction
The entire Silverlight application moves around the properties and events. We need to set-up the properties of element and attach event handler to their events to play. Ok...let’s talk about the topic that is Canvas and its properties. First define, what’s this?
We may define this as, it’s a container that contains many child elements like rectangle, text blocks etc but remember it can’t contain another canvas. Look at the screenshot below, it has five rectangles and each of them is aligned through its Canvas.Left and Canvas.Top properties.

<UserControl           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"           x:Class="SilverlightApplication1.MainPage"           Width="304" Height="304">
          <Canvas Background="Magenta">                    <Rectangle                    Canvas.Left="2" Canvas.Top=&quo…

Popular posts from this blog

5 Ways to send data between ASP.NET Pages