9 pág.

Pré-visualização | Página 1 de 2
Extensible Application Markup Language (XAML) Extensible Application Markup Language (XAML) es un lenguaje con el que puedes modificar los textos de los objetos xButton, pudiendo crear hipervinculos, margenes y muchas otras cosas que resultan bastante interesantes para personalizar al máximo nuestros botones. Más Información de MSDN XAML Contenido: Tags soportados por XAML Ejemplos Tags soportados por XAML Lo siguiente es una lista de etiquetas de XAML apoyadas y sus atributos: 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) Ejemplos Lo siguiente es ejemplos de textos en formato XAML del objeto de xButton que puede ser usado cuando esta activado el markup. Ejemplo hipervinculo Este ejemplo muestra el siguiente texto "Botón con Hipervínculo". Ejemplo <TextBlock>Botón con <Hyperlink>Hypervinculo</Hyperlink></TextBlock> Ejemplo texto en color Este ejemplo muestra el siguiente texto "Este texto es de color rojo" donde pone 'color rojo' es mostrado en color rojo mientras el texto restante es mostrado en el negro. Ejemplo <TextBlock><Run FontWeight='Bold'>Este texto es de </Run> <Bold><Run Foreground='Red'>color rojo</Run></Bold></TextBlock> Ejemplo italic y bold Este ejemplo muestra el siguiente texto "Esto es texto italic y esto es texto bold." Ejemplo <TextBlock>Esto es texto <Italic>italic</Italic> y esto es texto <Bold>bold</Bold>.</TextBlock> Ejemplo texto en dos niveles Este ejemplo muestra el siguiente texto "Estoy en la linea Superior Estoy en la linea Inferior" muestra cada frase en distinto niveles. Ejemplo <StackPanel> <TextBlock>Estoy en la linea Superior </TextBlock> <TextBlock>Estoy en la linea Inferior.</TextBlock> </StackPanel> Ejemplo texto auto ajustado Este ejemplo muestra el siguiente texto "Este texto esta en dos lineas" muestra el texto auto ajustado en medida de el tamaño del botón, ademas de ser auto ajustado el texto que se muestra centrado y con un margen minimo de distancia entre cada uno de los lados. Ejemplo <StackPanel> <TextBlock TextWrapping="Wrap" Margin="1, 1, 1, 1" TextAlignment ="Center"><Run>Este texto esta en dos lineas</Run></TextBlock> </StackPanel> Ejemplo fijar imagen y cursor Este ejemplo muestra el siguiente texto "Instala" seguido de una imagen. El cursor de ratón cambia a una mano cuando usted ratón sobre la imagen. Ejemplo <TextBlock FontSize="32" Padding = "3" VerticalAlignment="Center">Instala <Image Cursor="Hand" Source="file://AutoPlay/Images/check.png"/></TextBlock> Ejemplo texto con panel Este ejemplo muestra un xButton con el texto "Archivo de Ayuda" en formato centrado, en texto ademas incluye el comando TextWrapping =”Wrap” para que se ajuste el texto en diferentes lineas si es necesario. Ejemplo <StackPanel> <Border BorderThickness="1, 0, 1, 1" BorderBrush="#FF1493"></Border> <Border Cursor="Hand" Margin="0, 0, 0, 0" BorderThickness="1, 0, 1, 1" BorderBrush="#FF1493" Background="#FFB6C1"> <TextBlock TextWrapping="Wrap" Margin="12, 4, 12, 4" TextAlignment ="Center"><Run>Archivo de Ayuda</Run></TextBlock> </Border> </StackPanel> Ejemplo texto con panel con degradado lateral sin borde Este ejemplo muestra un xButton con el texto "Texto estara aqui en formato centrado, en texto ademas incluye el comando Wrap para que se ajuste el texto en diferentes lineas si es necesario, y el panel no lleva linea de borde y he puesto un degradado lateral de dos colores. Ejemplo <Page> <StackPanel> <Border Cursor="Hand" Margin="0, 0, 0, 0"> <Border.Background> <LinearGradientBrush EndPoint="1, 0.5" StartPoint="0,0.5"> <GradientStop Color="#FF8C00" Offset="0"/> <GradientStop Color="#FFFFFF" Offset="1"/> </LinearGradientBrush> </Border.Background> <TextBlock TextWrapping="Wrap" Margin="12, 4, 12, 4" TextAlignment ="Center"><Run>Texto estara aqui</Run></TextBlock> </Border> </StackPanel> </Page> Ejemplo texto con panel con degradado central con borde Este ejemplo muestra un xButton con el texto "Texto estara aqui en formato centrado, en texto ademas incluye el comando Wrap para que se ajuste el texto en diferentes lineas si es necesario, y el panel no lleva linea de borde y he puesto un