Tag: Example

Rectangle and ScaleTransform example in Silverlight and XAML

Below is a sample code snippet demonstrating how to use the ScaleTransform with the Rectangle control in Silverlight and XAML. Rectangle and ScaleTransform example in Silverlight and XAML <Canvas x:Name=”ACCanvas” xmlns=”http://schemas.microsoft.com/client/2007″ xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Width=”400″ Height=”300″ > <Canvas.Background> <SolidColorBrush Color=”Yellow”/> </Canvas.Background> <Rectangle Width=”190″ Height=”160″ Fill=”Red” Stroke=”Green” Canvas.Left=”200″ Canvas.Top=”50″ RenderTransformOrigin=”0,0″ > <Rectangle.RenderTransform> <ScaleTransform ScaleX=”2″ ScaleY=”2″/> </Rectangle.RenderTransform> </Rectangle> </Canvas>

Rectangle and RotateTransform example in Silverlight and XAML

Below is a sample code snippet demonstrating how to use the RotateTransform with the Recangle control in Silverlight and XAML. Rectangle and RotateTransform example in Silverlight and XAML <Canvas x:Name=”ACCanvas” xmlns=”http://schemas.microsoft.com/client/2007″ xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Width=”400″ Height=”300″ > <Canvas.Background> <SolidColorBrush Color=”Yellow”/> </Canvas.Background> <Rectangle Width=”190″ Height=”160″ Fill=”Red” Stroke=”Green” Canvas.Left=”200″ Canvas.Top=”50″ RenderTransformOrigin=”0,0″ > <Rectangle.RenderTransform> <RotateTransform Angle=”45″/> </Rectangle.RenderTransform> </Rectangle> </Canvas>

Example of Predicate Delegate in C#

Predicate Delegate is an interesting feature in .NET Framework which is like a reference to a function which returns either true or false. Example of Predicate Delegate in C# Below is a sample code snippet demonstrating the usage of Predicate Delegate in C#

Example of Object Initializer in C#

Object Initializer is one of the cool features in C# that lets the developers to initialize the objects as and when they are declared . Example of Object Initialize in C# Below is a sample code snippet that demonstrates how to use Object Initializers in C#.

Single Line and Multi Line Comment Example in C#

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication1 { #region testregion public partial class Form1 : Form { // Single Line Comment Test public Form1() { InitializeComponent(); } /* This is a Multiline Comment test */ private void Form1_Load(object sender, EventArgs e) { Debug.WriteLine(“This is a test message”); } } #endregion…

SelectMany Example in LINQ and C#

Below is a sample source code demonstrating the usage of the SelectMany method in LINQ and C#. One of the usage of the SelectMany is to return the flat list an avoid returning the lists of lists. SelectMany Example in LINQ and C#

Rectangle and SkewTransform example in Silverlight and XAML

Below is a sample code snippet demonstrating how to use the SkewTransform with the Rectangle control in Silverlight and XAML. Rectangle and SkewTransform example in Silverlight and XAML <Canvas x:Name=”ACCanvas” xmlns=”http://schemas.microsoft.com/client/2007″ xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Width=”400″ Height=”300″ > <Canvas.Background> <SolidColorBrush Color=”Yellow”/> </Canvas.Background> <Rectangle Width=”190″ Height=”160″ Fill=”Red” Stroke=”Green” Canvas.Left=”0″ Canvas.Top=”50″ RenderTransformOrigin=”0,0″ > <Rectangle.RenderTransform> <SkewTransform AngleX=”45″ /> </Rectangle.RenderTransform> </Rectangle> </Canvas>