Tag: XAML
Creating an Animation in XAML and Silverlight
Below is a sample code snippet that demonstrates how to create a simple animation in XAML and Silverlight Creating an Animation in XAML and Silverlight <Grid x:Name=”LayoutRoot” Background=”White”> <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> <TransformGroup> <RotateTransform x:Name=”RotateTransform” Angle=”0″/> <ScaleTransform x:Name=”ScaleTransform” ScaleX=”0″ ScaleY=”0″ /> </TransformGroup> </Rectangle.RenderTransform> </Rectangle> </Canvas> <Grid.Triggers> <EventTrigger RoutedEvent=”Grid.Loaded”>…
What is XAML?
What is XAML? XAML is a language from Microsoft which stands for eXtensible Application Markup Language. It is a declarative language used specially for defining application user interfaces. It is XML based. Each XAML tag corresponds to a class in .NET Framework and the properties represent XML attributes. Eg: <Button> </Button> The above tag represents a button that is defined in the System.Windows.Controls.Button
Creating a Button in UWP app by specifying the namespace as one of the attributes of button
You can add a button in your Universal Windows Platform (UWP) app by simply adding the Button tag in the Xaml page. You will notice that the Namespace “http://schemas.microsoft.com/winfx/2006/xaml/presentation” is already referred in the Page element. You can add a button in the UWP app page by specifying the namespace as one of the attributes of button instead of specifying it at the page level….
Creating a Simple Canvas in Silverlight using XAML
Below is a sample code snippet for creating a canvas control in Silverlight 5 using XAML. Creating a Simple Canvas in Silverlight using XAML <Canvas x:Name=”ACCanvas” xmlns=”http://schemas.microsoft.com/client/2007″ xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Background=”Green” Width=”400″ Height=”300″ > </Canvas>
How to Allow only numeric input in a Textbox in WPF ?
If you are looking at ways to accept only digits and decimal points (numeric input) for a textbox in WPF , you could do it by following the below steps. How to Allow only numeric input in a Textbox in WPF ? Add the Event PreviewTextInput for the Textbox in the XAML. In the Xaml.cs , add the following. The regular expression is used so…
Example of Property Elements in Xaml
The Syntax for the property element in Xaml is as follows below TypeName.PropertyName The property elements are always contained inside a typename object and they don’t have the attributes of their own. An example of the property element is the Button.Content property which is used to set the content of the button control which is of type object. The Below code is used to set…
How to Create ApplicationBar in Windows Phone using XAML ?
In one of the previous articles , we discussed how to create ApplicationBar programmatically during runtime using C# . This article will demonstrate how to create ApplicationBar using XAML. How to Create ApplicationBar in Windows Phone using XAML ? Below is a sample XAML code snippet which creates an ApplicationBar with one Menu Item and two ApplicationBarIconButton <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem IsEnabled=”True” Text=”ABundantCode”/> </shell:ApplicationBar.MenuItems> <shell:ApplicationBarIconButton…
How to Add Comment in XAML and Silverlight?
You can add comment in XAML using the following format <!– Your Comment –> How to Add Comment in XAML and Silverlight? Sample code snippet demonstrating the inclusion of the comments in XAML page. <!–This Section is a Grid Layout–> <Grid x:Name=”LayoutRoot” Background=”White”> <Canvas x:Name=”ACCanvas” xmlns=”http://schemas.microsoft.com/client/2007″ xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Background=”Green” Width=”400″ Height=”300″ > <Ellipse x:Name=”ACEllipse” Fill=”Red” Stroke=”Pink” Width=”200″ Height=”200″/> </Canvas> </Grid>
XAML Designer options in Visual Studio
Visual Studio 2015 has an interesting feature in the IDE that is related to the XAML Designer . As a Developer , you can perform the following options in the Visual Studio 2015 IDE specially on the XAML designer.1. Disable the XAML Designer.2. Set the Default document view for the XAML designer.3. Set the Split Orientation for the designer.4. Set the shortcut key for the…
What are Attached Properties in XAML?
The Attached Properties in XAML are the properties which can be used by other classes. A simple example of the attached properties is the Grid.Row property in the Stack Panel which defines where in the grid, the stack panel will be displayed in the Grid. What are Attached Properties in XAML ?
How to embed Rectangle inside a Button in Xaml ?
Below is a sample code demonstrating how to embed a rectangle inside a Button in Xaml . How to embed Rectangle inside a Button in Xaml ?
Keywords in XAML Language Namespace
Below are some of the keywords defined in the Xaml Language Namespace Keywords in XAML Language Namespace x:Arrayx:Codex:ConnectionIdx:Argumentsx:Staticx:AsyncRecordsx:Booleanx:Bytex:Charx:Decimalx:Doublex:Int16x:Int32x:Int64x:Singlex:Stringx:TimeSpanx:FactoryMethodx:ClassAttributesx:Classx:ClassModifierx:FieldModifierx:Keyx:Namex:Nullx:Uidx:Urix:Objectx:Propertyx:Referencex:Sharedx:Subclassx:SynchronousModex:Type