Posts

Showing posts with the label Silverlight

Scene Order (Layer Order) in XAML Silverlight

Image
Introduction XAML is fully based on composition of objects scenes. Every XAML page has a parent/top most container (like UserControl/Canvas/Page etc) and it may have zero more children elements like (like Grid/Rectange/Ellipse etc). Look at the example below: In above screenshot, I have used three elements named LayoutRoot, LayoutRoot1 and Rec1. LayoutRoot (White Background) is lower most (beneath), look at the code above and examine the order of elements: 1.     LayoutRoot (Grid) 2.     LayoutRoot1 (Grid) 3.     Rec1 (Rectangle) Please note that, usually we write code top to bottom approach in general so, the order of shapes (elements) also varies on this. If you wish to bring ‘LayoutRoot (White Grid)’ to front then the order of element will also be rearranged automatically. Look at screenshot below: In above screenshot, I’m bringing the white art (LayoutRoot) to front then, in code window that grid will also be rearranged. Look at screenshot below:

ScaleTransform in XAML Silverlight

Image
Introduction In Silverlight ‘ScaleTransform’ is used to stretch or shrink element horizontally or vertically. It has mainly two properties ScaleX and ScaleY. By default ScaleX and ScaleY values are 1. We either can increase 1 or decrease 1 for its both properties. ·          ScaleX The ScaleX property specifies the amount to stretch or shrink element along X-axis. ·          ScaleY The ScaleY property specifies the amount to stretch or shrink element along Y-axis. In above screenshot, I have used three Text Blocks to clarify the basics of scaling.

Rotate Transform in XAML

Image
Introduction In Silverlight ‘RotateTransform’ is defined by its angle property; here a specified angle rotates the element. When we use ‘RotateTransform’, the transformation rotates the coordinate system for a particular object by using the point 0, 0. Therefore, depending on the position of the object, it might not rotate in place (around its center). For example, if an object is positioned 200 units from 0 along the x-axis, a rotation of 30 degrees can swing the object 30 degrees along a circle that has a radius of 200, which is drawn around the origin. To rotate an object in place, set theCenterX and CenterY of the RotateTransform to the center of the object to rotate. Look at the previous post here. In above screenshot, I have used two Text Blocks to clarify the basics rotation here. I have marked its coordinate by (0,0) and also the 90 degree rotation.

Namespaces in XAML

What is Namespace? Before using or talking about namespaces let’s talk what is this? Namespaces are an abstract container or environment created to hold a logical grouping of unique identifiers or symbols. An identifier defined in a namespace is associated only with that namespace. The same identifier can be independently defined in multiple namespaces. That is, the meaning associated with an identifier defined in one namespace may or may not have the same meaning as the same identifier defined in another namespace. Languages that support namespaces specify the rules that determine to which namespace an identifier belongs. XML Namespaces <?xml version="1.0" encoding="UTF-8"?> <users xmlns=" http://www.w3.org/1999/xhtml ">   <siteuser>     <url>http://www.itorian.com/</url>     <user>akvatsa</user>     <name>ABHIMANYU KUMAR VATSA</name>   </siteuser> </users>

MatrixTransform in XAML Silverlight

Image
Introduction In Silverlight ‘MatrixTransform’ creates an arbitrary affine matrix transformation that is used to manipulate objects or coordinate systems in a two-dimensional plane. Matrix Transformation is subject of Mathematical calculation and it’s not really complication as looks. Well, look at some properties of MatrixTransform that are important to know, consider the screenshot too: Attributes of MatrixTransformation M11 (Default value 1) This is the value at position (1, 1) as in Mathematics, confused let me explain. M11 is just a point at position (1, 1). If element (here Grid) has width as 250 (look in screenshot below) will be considered as 1. If we doubled the value of M11 from 1 to 2 then transformed size will be about [250x2] 500. M12 (Default value 0) This is the value at position (1, 2) as in Mathematics. Look at screenshot for more explanation. M21 (Default value 0) This is the value at position (2, 1) as in Mathematics. Lo

LinearGradientBrush in XAML Silverlight

Image
Introduction In Silverlight, LinearGradientBrush paints area with a gradient. A linear gradient defines a gradient along a line. The line’s end point is defined by the Start and End points properties of the linear gradient. LinearGradientBrush paints these stops along this line. Working on LinearGradientBrush by hand is very tedious job especially when we have many colors. Here color picker will be very useful. Let’s talk how to work with this. To work with color picker, select the third tab allows to visually editing gradient brushes. The gradient brush editor fully based on GradientStop slider. Look at below: In above image, we have used 5 stopper and each has different color gradient. Stopper location is known as Offset point. Offset value always varies between 0 to 1. Each stopper has offset value which locates the position on slider. By using marked point (red circle) we can reverse the gradient stopper. By using marked point (blue circle) we can

Introduction of code-behind XAML Silverlight

Image
Introduction Usually every XAML file has a corresponding code-behind page and code-behind language could have C# (this is default) or VB. At very first time when we create a new project, project selection windows has option to choose development language. Here it is: Well, look at the screenshot given below, recall the Visual Studio ASP.Net development, we create new project and project explorer lists the files and a file named Default.aspx is default for our entire web project (in general), in Blend MainPage.xaml has the same role here (in general but both are very different stocks, will talk later). Also recall web.config file, app.xaml same role here (in general but both are very different stocks, will talk later). We start our editing or development in Blend from MainPage.xaml page and it is very important to understand the logics of both pages. Both screenshots has same page code-front (bottom one) and code-behind (just above the bottom one) shown. A

Introduction of Brushes tools in XAML Silverlight

Image
Introduction In Silverlight, Brushes is very useful component, it allows selecting any color in variety of ways, and provides visual (user friendly) feedback to play with colors. Any element can be filled using brushes tools. Let’s look at the screenshot of ‘Brushes’ section in Silverlight. Let’s discuss about its all items. Fill This item gets or sets the brush that specifies how to paint the interior of the shape. Stroke This item gets or sets the brush that specifies how to paint the shape outline (border). OpacityMask This item gets or sets an opacity mask as brush implementation that is applied to any alpha-channel masking for the rendered content of this element. Look at the screenshot below for more options:- 1. By selecting this option we hide every brush selections or simply say, select this option if you don’t want color box to be appear. 2. By selecting this we can apply solid color to any shape (no any special effect of

Introduction to Silverlight 4

Image
It is a powerful development platform for creating rich media applications for the web, desktop and mobile devices. It is a new cross-browser, cross-platform implementation of the .Net Framework for building and developing the next generation of media experiences and Rich Interactive Application for the web users to provide a dynamic experience by using all stuffs like animation, audio, video etc. It runs in all popular/modern browsers like Internet Explorer, Firefox, Safari, Google Chrome running on Microsoft Windows, Mac OS. The very small plug-in requires to run Silverlight and it is freely available on internet. Silverlight is combination of different technologies into a single development platform that allows us to select tools and the programming language to use in development. Silverlight can also be integrated into existing ASP.NET, JavaScript or AJAX code to complete the functionality. The main aim of Silverlight is to compete with Adobe product ‘Flash’ and the pres

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System

Lambda two tables and three tables inner join code samples