ContentsXAML Syntax
Extensible Application Markup Language (XAML) is a markup language used in markup enabled xButton objects for advanced text formatting such as highlighting, hyperlinks and more. For further information, see the MSDN XAML Overview.
The following is a list of supported XAML tags and their attributes:
Tags |
Attributes |
Page |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height,MinWidth, MaxWidth, MinHeight, MaxHeight,) |
Border |
(Cursor, Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth,MinHeight, MaxHeight, Padding, Background, BorderThickness, BorderBrush) |
TextBlock |
(Cursor, Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Padding, Background, Foreground, TextWrapping, TextAlignment, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle, BaselineAlignment, Text) |
Image |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Source) |
Run |
(Cursor, Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle, BaselineAlignment, Text) |
LineBreak |
no attributes |
Span |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
Bold |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
Italic |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
Underline |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
InlineUIContainer |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
Hyperlink |
(Background, Foreground, TextDecorations, FontSize, FontWeight, FontFamily, FontStyle) |
Panel |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Background) |
StackPanel |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Background, Orientation) |
WrapPanel |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Background, Orientation, ItemHeight, ItemWidth) |
Canvas |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Background, Left, Right, Top, Bottom) |
Grid |
(Style, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, MaxHeight, Background, ColumnDefinitions, RowDefinitions) |
ColumnDefinition |
(Width, MinWidth, MaxWidth) |
RowDefinition |
(Height, MinHeight, MaxHeight) |
Polygon |
(Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, Points) |
Polyline |
(Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, Points) |
Rectangle |
(IsMouseOver, Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight) |
Ellipse |
(Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight) |
Line |
(Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, X1, Y1, X2, Y2) |
Button |
(IsPressed, Style, Width, Margin, ClipToBound, HorizontalAlignment, VerticalAlignment, Width, Height, MinWidth, MaxWidth, MinHeight, Content) |
CheckBox |
no attributes |
RadioButton |
no attributes |
ScrollViewer |
(Style, VerticalScrollBarVisibility, HorizontalScrollBarVisibility) |
SolidColorBrush |
(Color) |
LinearGradientBrush |
(StartPoint, EndPoint, GradientStops) |
GradientStop |
(Color, Offset) |
Style |
(TargetType, BasedOn, Resources) |
Setter |
(Property, Value) |
The following are examples of xButton object XAML text that can be used when Enable markup is selected.
<TextBlock>Button with <Hyperlink>Hyperlink</Hyperlink></TextBlock>
This example shows the text "Button with Hyperlink" when used on a markup enabled xButton object.
<TextBlock><Run FontWeight='Bold'>This text is </Run> <Run Foreground='Red'>colored red</Run></TextBlock>
This example shows the text "This text is colored red" where 'colored red' is shown in red while the remaining text is shown in black.
<TextBlock>This is <Italic>italic</Italic> text and this is <Bold>bold</Bold> text.</TextBlock>
This example shows the text "This is italic text and this is bold text."
<TextBlock>This is <Italic>italic</Italic> text and this is <Bold>bold</Bold> text.</TextBlock>
This example shows the text "This is italic text and this is bold text."
<TextBlock FontSize="32" Padding = "3" VerticalAlignment="Center">Install <Image Cursor="Hand" Source="file://AutoPlay/Images/check.png"/></TextBlock>
This example shows the text "Install" followed by an image. The mouse cursor changes to a hand when you mouse over the image.
<StackPanel TextBlock.FontFamily="Tahoma">
<TextBlock Padding="1, 3, 1, 3" FontWeight="Bold">Install</TextBlock>
<TextBlock Padding="9, 6, 30, 7" TextWrapping="Wrap">Click to install the software.</TextBlock>
<Border Height="1" Background="#9ebbdd" />
<Border Height="1" Background="White" />
<StackPanel Margin="1, 7, 0, 3" Orientation="Horizontal">
<TextBlock Margin="7, 0, 0, 0" VerticalAlignment="Center" FontWeight="Bold"><Hyperlink>More Info</Hyperlink></TextBlock>
</StackPanel>
</StackPanel>
This example shows an xButton with the text "Install" in bold, on the next line the indented text "Click to install the software." followed by a separator and a hyperlink labeled "More Info.
<Page>
<StackPanel>
<Border Cursor="Hand" BorderThickness="1" BorderBrush="#bdcaea">
<Border.Background>
<LinearGradientBrush EndPoint="1, 0.5" StartPoint="0, 0.5">
<GradientStop Color="#c3d6ff" Offset="0"/>
<GradientStop Color="#eef2ff" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Install" Foreground="#30486e" FontSize="18" Margin="12,2,2,2"/>
<TextBlock Grid.Column="1" Margin="2,2,12,2"><Hyperlink Foreground="#047c05" FontSize="18">More Info</Hyperlink></TextBlock>
</Grid>
</Border>
<Border Margin="0, 0, 0, 0" BorderThickness="1, 0, 1, 1" BorderBrush="#bdcaea" Background="#eff3ff">
<TextBlock TextWrapping="Wrap" Margin="12, 4, 12, 4"><Run>Click to install the software from D:\install</Run></TextBlock>
</Border>
</StackPanel>
</Page>
This example shows an xButton with a panel within the button containing the formatted text "Install", beside it a hyperlink "More Info" and below the text "Click to install the software from D:\install."